In [3]:
%matplotlib inline
import pandas as pd
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
Copy this notebook. Rename it as: YOURNAME-HW3-matplotlib-XX
with your name replacing YOURNAME and the xx replaced with the date you submit or copy this HW.
.
Upload your completed jupyter notebook to elearning site as your homework submission. Do not put this notebook on your github.
Couple of reference site:
Do all the homeworks problems below: As noted doing the homework gets a 3 out of 5. To do more create tutorials on how to create an interesting plot or set of plots that are not in this HW.
In [ ]:
Make a combined plot of a red spiral with a scatter plot.
The red spiral has r from 0 to 3 with steps of 0.1 and a theta of 2 pi r.
The scatter uses the same theta as the spiral but the radius r is offset by a random value ranging from -.5 to .5. The size of the plotted locations is 100 * r^2 and the color uses theta.
Use an alpha value of .4 for the colors in the scatter plot. Limit the size of the plot (rmax) to 2.5
Should look something like:
In [ ]:
In [ ]:
Show the same data in homewowrk 3.3 in a 3d plot. Use a numpy.histrogram2d funtion to generate the data: http://docs.scipy.org/doc/numpy/reference/generated/numpy.histogram2d.html
Need to use statements:
from mpl_toolkits.mplot3d import Axes
fig = plt.figure()
ax = fig.gca(projection='3d')
...
ax.plot_surface(xm,ym,hist,rstride=1,cstride=1,cmap=plt.cm.jet)
</em>
Should look something like:
In [ ]: