<jupyter_start><jupyter_text>Visualization 1: Matplotlib Basics Exercises<jupyter_code>%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
from __future__ import print_function
from IPython.html.widgets import interact, interactive, fixed
from IPython.html import widgets<jupyter_output>:0: FutureWarning: IPython widgets are experimental and may change in the future.<jupyter_text>Scatter plots Learn how to use Matplotlib's `plt.scatter` function to make a 2d scatter plot.* Generate random data using `np.random.randn`.* Style the markers (color, size, shape, alpha) appropriately.* Include an x and y label and title.<jupyter_code>randx = np.random.randn(500)
randy = np.random.randn(500)
plt.scatter(randx, randy, color = "g", marker = "x")
plt.xlabel("Random X")
plt.ylabel("Random Y")
plt.title("Random Data!!!!!")
plt.box(False)
plt.grid(True)<jupyter_output><empty_output><jupyter_text>Histogram Learn how to use Matplotlib's `plt.hist` function to make a 1d histogram.* Generate randpom data using `np.random.randn`.* Figure out how to set the number of histogram bins and other style options.* Include an x and y label and title.<jupyter_code>data = np.random.randn(500000)
def plothist(bins, numdata):
    plt.hist(np.random.randn(numdata), bins=bins, color = "k", ec = "w")
interact(plothist, bins=widgets.IntSlider(min=1,max=100,step=1,value=10), numdata=\
         widgets.IntSlider(min=10,max=10000,step=10,value=10));
plt.xlabel("Random Variable X")
plt.ylabel("Counts")
plt.title("Distribution of a random variable in abjustable bins.")<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup