Forums

Pyplot

Why isn't this generating any output?

import matplotlib.pyplot as plt import numpy as np

Generate a sequence of um numbers from -10 to 10 with 100 steps inbetween

x=np.linspace(-10,10,100)

Create a second arrray using sine

y=np.sin(x)

The plot function makes a line chart of one arrrray against another

plt.plot(x,y,marker="x")

Hi there, does this help? http://help.pythonanywhere.com/pages/MatplotLibGraphs

paying users can also use Jupyter Notebooks, which are popular for science and graphing types of activities...