Use the following data to make your plot:
import numpy as np
x = np.arange(1, 13)
y = np.array([7, 8, 5, 5, 3, 4, 4, 6, 9, 7, 8, 8])
- Add a bar chart to your plot, using
xandyabove. Fix it so there is no outline (edgecolor), set the color of the bars to green, and set their width to 0.25. - Fix your X-axis to go from 1 to 13.
- Fix your Y-axis to go from 0 to 10.
- Add a label to your X-axis that says "month of the year".
- Add a label to your Y-axis that says "letters in month name".
- Add a title to your plot, "Leters in the Name of Each Month".
- Display your plot.
Use the following data:
import numpy as np
x = np.arange(0.0, 2 * np.pi, np.pi / 16.0)
y = 2 * np.cos(x)
- Add a line plot, using
xandyabove. Set the width of the line to 3, set the color to green, set the style to dashed, with a label of "approx". - Add a scatter plot, using
xandyabove. Set the size to 1000, set the edgecolor to none, set the color to blue, and set the label to "discrete". - Add an X label of "x".
- Add a Y label of "Y".
- Add a title of "2 * cos(x)".
- Save your plot to a file named "cos.png".
Use the following data:
import numpy as np
mu = 10500
sigma = 250
values = mu + sigma * np.random.randn(10000)
x = mu + sigma * np.random.randn(100)
y = mu + sigma * np.random.randn(100)
- Use
subplotto initialize the first plot (left column) in a two-column subplot image. - Create a histogram of
valueswith 25 columns, set the facecolor to green, and set the edgecolor to none. - Give the plot a Y-label of "count" of values".
- Use
subplotto intiialize the second plot (right column) in a two-column subplot image. - Create a scatter plot of
xandy, set the area to 300, set alpha to 0.25, set edgecolor to none, set color equal torandom.rand(100). - Give the plot a X-label of "x".
- Give the plot a Y-label of "y".
- Set the x-limits of the plot to: 10,000 to 11,000.
- Set the y-limits of the plot to: 10,000 to 11,000.
- Add a grid to the plot.
- Show the plot.