+ 1

Graphs Using Python

import matplotlib.pyplot as pp import numpy as np x=np.array([1,8]) y=np.array([3,10]) pp.plot(x,y) pp.show() Does solo learn don't support matplotlib or it is wrong . It is showing None 😭😔 Help ! ! !

20th Sep 2024, 5:20 PM
ᎢㅤᏆㅤᎷㅤᎬㅤ✨
ᎢㅤᏆㅤᎷㅤᎬㅤ✨ - avatar
2 Réponses
+ 3
On Sololearn you need an extra step. Save the plot as a .png file. pp.savefig('plot.png') Then their batch program will recognize that it needs to enable html display and it will show the image.
20th Sep 2024, 5:49 PM
Brian
Brian - avatar
+ 2
just a note: alias convension is plt (not pp) just in case if you would like to do something for anybody else, or in a team...., or is you see someone's code
20th Sep 2024, 7:19 PM
Mihaly Nyilas
Mihaly Nyilas - avatar