Forums

simple plot with matplotlib

I tried a simple plot in pythonanywhere, here the code:

from matplotlib import * import matplotlib.pyplot as plt fig = plt.figure() plt.plot([1, 2, 3, 4]) plt.xlabel("t") plt.ylabel("y") plt.show()

I get no error message, but also no plot :( Any idea?

There is no screen for the plot to be drawn on. Your best bet is to save the figure as an image and then view it in your browser. As detailed on the wiki

Thank you,. it works. Regards,

Felix

Cool

For jupyter notebook users, you can also have inline graphics in your notebook directly. This option is currently in beta and available only to paying users as of right now though.