Locked lesson.
About this lesson
In this video, we explain what a hexplot is and how to create your own.
Exercise files
Download this lesson’s related exercise files.
Plotting HexPlots.docx57 KB Plotting HexPlots - Solution.docx
55.6 KB
Quick reference
Plotting HexPlots
A Hex plot shows a histogram of the number of occurrences of the observations of your data.
When to use
Use these to visualize a histogram of the number of occurrences of the observations of your data.
Instructions
The first method to create a hex plot:
my_df.plot(kind='hexbin', x='Mon', y='Tues')
To change the size of your hex plot, set the grid size:
my_df.plot(kind='hexbin', x='Mon', y='Tues', gridsize=10)
The second method for creating a hex plot:
my_df.plot.hexbin(x='Mon', y="Tues", gridsize=10)
Hints & tips
- my_df.plot(kind='hexbin', x='Mon', y='Tues', gridsize=10)
- my_df.plot.hexbin(x='Mon', y="Tues", gridsize=10)
Lesson notes are only available for subscribers.