Plot Types
Let’s learn about the plot types available in pandas.
We'll cover the following...
We'll cover the following...
There are several built-in plot types in pandas. Most of these are statistical plots by nature. Some examples of built-in plot types are given below:
df.plot.areadf.plot.bardf.plot.barhdf.plot.histdf.plot.linedf.plot.scatterdf.plot.boxdf.plot.hexbindf.plot.kdedf.plot.densitydf.plot.pie
We can also, instead of using the methods above, call df.plot(kind='hist') and replace the kind argument with any of the key terms shown in the list above (like 'box', 'barh', and so on).
Let’s go through these plots one by one using our Data Frames df1 and df2.
Area plot
This is used to plot a stacked area:
Bar plots
We can plot our DataFrame as bars as well:
Horizontal bar plots
The barh() method is used to print the DataFrame as a horizontal bar plot. Let’s see this with an example:
Stacked bar plot
We can stack them on top of ...