Plotting with pandas
Both Series
and DataFrame
objects have a plot()
method that allows us to create several different plots and control some aspects of their formatting, such as subplot layout, figure size, titles, and whether to share an axis across subplots. This makes plotting our data much more convenient, as the bulk of the work to create presentable plots is achieved with a single method call. Under the hood, pandas
is making several calls to matplotlib
to produce our plot. Some of the most frequently used arguments to the plot()
method include the following:
Rather than having separate functions for each plot type, as we saw during our discussion of matplotlib
, the plot()
method from pandas
allows us to specify the type of plot we want using the kind
argument. The choice of plot will determine which other arguments are required. We can use the Axes
object that's returned by the plot...