5/10/23, 18:17 about:blank
Data Visualization with Python
Cheat Sheet : Plotting with Matplotlib using Pandas
Plot Type Description Pandas Function Example Visual
Shows trends and changes [Link]()
Line Plot [Link](x=’year’, y=’sales’, kind=’line’)
over time [Link](kind = ‘line’)
Displays data series as
[Link]()
Area Plot filled areas, showing the [Link](kind = ‘area’)
[Link](kind='area')
relationship between them
Displays bars representing
[Link]() [Link](kind='hist', bins=10)
Histogram the data count in each [Link](kind = ‘hist’, bins = n) df[‘age’].plot(kind='hist', bins=10)
interval/bin
Displays data using [Link]()
Bar Chart [Link](kind='bar')
rectangular bars [Link](kind = ‘bar’)
Displays data as a circular [Link]()
plot divided into slices, [Link](kind = ‘pie’) [Link](kind='pie’,autopct='%1.1f%%')
Pie Chart
representing proportions or [Link](y, labels) [Link](x='Category',y='Percentage',kind='pie')
percentages of a whole [Link](kind = ‘pie’)
Displays the distribution of
[Link]()
Box Plot a dataset along with key [Link](kind = ‘box’)
df_can.plot(kind='box')
statistical measures
Uses Cartesian coordinates
[Link]()
Scatter Plot to display values for two [Link](x, y, kind = ‘scatter’)
[Link](x='Height', y='Weight', kind='scatter')
variables
Cheat Sheet : Plotting directly with Matplotlib
Plot Type Description Matplotlib Function Example Visual
Shows trends and changes
Line Plot [Link]() [Link](x, y, color='red', linewidth=2)
over time
about:blank 1/2
5/10/23, 18:17 about:blank
Plot Type Description Matplotlib Function Example Visual
Display data series as filled plt.fill_between(x, y1, y2, color='blue',
Area Plot plt.fill_between()
areas alpha=0.5)
Displays bars representing
[Link](data, bins=10, color='orange',
Histogram the data count in each [Link]()
edgecolor='black')
interval/bin
Displays data using [Link](x, height, color='green',
Bar Chart [Link]()
rectangular bars width=0.5)
Displays data as a circular
plot divided into slices, [Link](sizes, labels=labels,
Pie Chart [Link]()
representing proportions or colors=colors, explode=explode)
percentages of a whole
Displays the distribution of
Box Plot a dataset along with key [Link]() [Link](data, notch=True)
statistical measures
Uses Cartesian coordinates
[Link](x, y, color='purple',
Scatter Plot to display values for two [Link]()
marker='o', s=50)
variables
Creating multiple plots on fig, axes = [Link](nrows=2,
Subplotting [Link]()
one figure ncols=2)
[Link]('Title')
Customizing plot: adding [Link]('X Label')
Customization Various customization [Link]('Y Label')
labels, title, legend, grid [Link]()
[Link](True)
Author(s)
Dr. Pooja
Changelog
Date Version Changed by Change Description
2023-06-10 0.1 Dr. Pooja Initial version created
about:blank 2/2