i like this post (click again to cancel)
2
i dont like this post (click again to cancel) remove favorite mark from this question (click again to restore mark)

I have a set of x,y data points as separate numpy arrays. How can I plot them?

comments (1)
1 Answers:
i like this answer (click again to cancel)
3
i dont like this answer (click again to cancel)

Use matplotlib:

import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(-5, 5)
y1 = x*x
y2 = x**1.5
plt.plot(x, y1)
plt.plot(x, y2, 'r--') # Optional linestyle: 'r--' means dashed red line
plt.xlabel('X')
plt.ylabel('Y')
plt.legend(['$X^2$', '$X^{1.5}$'], loc='upper center')
plt.title('Function Plotting!')
plt.show()
permanent link | flag offensive
asked 2009-08-21 16:46:02
dopplershift's gravatar image
51
add comment
Your answer:
You are now not logged in but you can answer first and then login
toggle preview

Made with Django.