import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
"""
Create matrix of ones
"""
a = np.ones((5,10))
# end
"""
First plot y = x
Now plot y = sin(x) on a second y axis
Make the x range 0 to 4 pi
Save to dual.png
"""
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
"""
Create matrix of ones
"""
a = np.ones((5,10))
# end
"""
First plot y = x
Now plot y = sin(x) on a second y axis
Make the x range 0 to 4 pi
Save to dual.png
"""
x = np.linspace(0,4*np.pi,100)
y = x
plt.plot(x,y)
y = np.sin(x)
plt.plot(x,y)
plt.savefig('dual.png')
Go to Google Form