%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

"""
Explanation: Visualization 1: Matplotlib Basics Exercises
End of explanation
"""


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)

"""
Explanation: 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.
End of explanation
"""


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.")

"""
Explanation: 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.
End of explanation
"""


