- Trending Categories
- Data Structure
- Operating System
- MS Excel
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- 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 plot two violin plot series on the same graph using Seaborn?
To plot two violin plot series on the same graph using Seaborn, we can take the following Steps.
Set the figure size and adjust the padding between and around the subplots.
Load an example dataset from the online repository (requires Internet).
Create a violin plot using violinplot() method.
To display the figure, use Show() method.
# Import Seaborn and Matplotlib import seaborn as sns from matplotlib import pyplot as plt # Set the figure size plt.rcParams["figure.figsize"] = [7.00, 3.50] plt.rcParams["figure.autolayout"] = True # Load an example dataset tips = sns.load_dataset("tips") # Create a violin plot using Seaborn sns.violinplot(x="day", y="total_bill", hue="time", data=tips) # Display the plot plt.show()
It will produce the following output −
- Related Articles
- How to plot a time series graph using Seaborn or Plotly?
- How to plot multiple histograms on same plot with Seaborn using Matplotlib?
- Create a Violin Plot with SeaBorn – Python Pandas
- How can every violin in a violin plot be split in Python Seaborn Library?
- Python - Create a Time Series Plot using Line Plot with Seaborn
- How can I plot two different spaced time series on one same plot in Python Matplotlib?
- How to plot two Pandas time series on the same plot with legends and secondary Y-axis in Matplotlib?
- Python Pandas - Draw swarms of observations on top of a violin plot with Seaborn
- How to plot int to datetime on X-axis using Seaborn?
- How to add a legend on Seaborn facetgrid bar plot using Matplotlib?
- How to show a bar and line graph on the same plot in Matplotlib?
- How to draw a violin plot in R?
- How can box plot be overlaid on top of swarm plot in Seaborn?
- How to plot two Seaborn lmplots side-by-side (Matplotlib)?
- Python Pandas - Draw a violin plot and set quartiles as horizontal lines with Seaborn