matplotlib is a very popular visualization library written in Python. We will cover some of the most commonly used visualizations. Let's start by importing the library:
>>>import matplotlib >>>import matplotlib.pyplot as plt >>>import numpy
We will use the same running data set from the Dow Jones index for some of the visualizations now. We already have stock data for company "AA". Let's make one more frame for a new company CSCO, and plot some of these:
>>>stockCSCO = stockdata_new.query('stock=="CSCO"') >>>stockCSCO.head() >>>from matplotlib import figure >>>plt.figure() >>>plt.scatter(stockdata_new.index.date,stockdata_new.volume) >>>plt.xlabel('day') # added the name of the x axis >>>plt.ylabel('stock close value') # add label to y-axis >>>plt.title('title') # add the title to your graph >>>plt.savefig("matplot1.jpg") # savefig in local
You can also save the figure...