+ 1

How to output matplotlib plots? [Solved]

My code has animated plot in Python. However, it seems that plots don't show here. I saw people using PLT.savefig("name") to plot a regular plot. https://code.sololearn.com/c47q4TPxZww0/?ref=app

12th Sep 2023, 7:18 PM
Juan
Juan - avatar
4 ответов
+ 5
On Sololearn if you create a .png file during runtime it will get displayed after your program runs. Almost any image type will get recognized as long as you name it with a .png extension. Here is a simple demo that displays an animated GIF. (It was the first user-written Python program to do so on Sololearn). https://code.sololearn.com/c10iqZtr0FJw/?ref=app
12th Sep 2023, 8:53 PM
Brian
Brian - avatar
+ 3
Juan You only have one option, save the animation as a gif and rename it to png https://code.sololearn.com/cWrQTiGVB73R
12th Sep 2023, 10:06 PM
Alexey Kopyshev
Alexey Kopyshev - avatar
+ 2
Juan With plt.savefig(), you can save and show the graph/plot. All other graphics, including animations, are not supported in Sololearn
12th Sep 2023, 8:49 PM
Alexey Kopyshev
Alexey Kopyshev - avatar
+ 1
Thanks! I mostly fixed it now.
14th Sep 2023, 3:42 PM
Juan
Juan - avatar