- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to make a grouped boxplot graph in matplotlib?
To make a grouped boxplot graph in matplotlib, we can take the following steps −
- Import matplotlib.pyplot and seaborn.
- Set the figure size and adjust the padding between and around the subplots.
- Load an example Seaborn dataset from the online repository.
- Make a boxplot with male and female group in a single day.
- To display the figure, use show() method.
import seaborn as sns import matplotlib.pyplot as plt # Set the figure size plt.rcParams["figure.figsize"] = [7.00, 3.50] plt.rcParams["figure.autolayout"] = True # Import a Seaborn dataset data = sns.load_dataset('tips') # Create a grouped boxplot sns.boxplot(x=data['day'], y=data['total_bill'], hue=data['sex']) plt.show()
It will produce the following output
- How to create boxplot of grouped data in R?
- How to create a Boxplot with Matplotlib?
- How to get boxplot data for Matplotlib boxplots?
- Python Pandas - Draw a vertical boxplot grouped by a categorical variable with Seaborn
- How to plot a high resolution graph in Matplotlib?
- How to make a multicolored point in Matplotlib?
- How to make a rug plot in Matplotlib?
- How to make a mosaic plot in Matplotlib?
- Adding a scatter of points to a boxplot using Matplotlib
- How to manage image resolution of a graph in Matplotlib
- How to make a simple lollipop plot in Matplotlib?
- How to color a Seaborn boxplot based on DataFrame column name in Matplotlib?
- How to make axes transparent in Matplotlib?
- How to give a Pandas/Matplotlib bar graph custom colors?
- Animate a rotating 3D graph in Matplotlib