syntax.us Let the syntax do the talking
Blog Contact Posts Questions Tags Hire Me

Question:
In Python Matplotlib how do I plot 3 y-values on 1 plot?

Let the syntax do the plotting:
# /a/ks/b/python/matplotlib3sets1plot.py

# ref:
# http://matplotlib.org/users/pyplot_tutorial.html

import numpy as np
import matplotlib.pyplot as plt

# evenly sampled time at 200ms intervals
t = np.arange(0., 5., 0.2)

# red dashes, blue squares and green triangles
plt.plot(t, t, 'r--', t, t**2, 'bs', t, t**3, 'g^')
plt.show()

Gives me:


syntax.us Let the syntax do the talking
Blog Contact Posts Questions Tags Hire Me