MSK Institute LogoMSK.Institute
HomeCourses
Book Free Demo➔Sign In
Free Demo➔
MSK Institute LogoMSK.Institute

Leading computer training academy in Shikohabad for software engineering, Python, web development, and digital literacy.

ISO 9001:2015 Certified Center
Follow & Connect
4.9

Programs & Admissions

  • All CoursesCatalog
  • Learning PathsRoadmaps
  • Student ProjectsShowcase
  • Live Classes & ScheduleLive
  • Upcoming Batches
  • Campuses & LocationsHub
  • Verify Certificates
  • Book Free Demo Class

Resources & Tools

  • Free Online Mock TestsAll Tests
  • NIELIT CCC Mock TestFree
  • Course & Career FinderQuiz
  • Study Material Hub
  • All MSK ToolsHub
  • Keyboard ShortcutsNew
  • TypeQuest Speed LabTyping
  • MSK Code PlaygroundCode
  • Interactive Tutorials
  • Quick Cheatsheets

Institute & Contact

  • About MSK Institute
  • Careers & InternshipsHiring
  • Publications & Blogs
  • Gali No. 3, Near Gyan Jyoti Public School,
    Adarsh Nagar, Shikohabad, Uttar Pradesh 283135
  • +91 83930 42166
  • mskshikohabad@gmail.com
  • Hours:Mon – Sat: 8:00 AM – 7:00 PM | Sun: 10:00 AM – 2:00 PM
  • 4.9 ★(38 Google Reviews)
© 2026 MSK Institute. All rights reserved.•Privacy Policy•Terms of Service•Disclaimer•Contact Us

Shikohabad's Leading Computer & Coding Academy

Home
Courses
Live
Material
Categorical Plots: boxplot, violinplot, and countplot0%
Study MaterialsCheatsheet
Data Visualization & Applied StatisticsProgress 0%
1.1Why Data Visualization Matters in Decision Making1.2Python Visualization Landscape: Matplotlib vs Seaborn vs Plotly1.3Setting Up Jupyter, Inline Plotting & Figure Sizing
3.1Seaborn Themes, Palettes & Aesthetics3.2Distribution Plots: histplot, kdeplot, and ecdfplot3.3Categorical Plots: boxplot, violinplot, and countplot3.4Relational Plots: scatterplot with hue & size mapping3.5Correlation Heatmaps & PairPlots for Multivariate EDA
HomeTutorialsData Visualization & Applied StatisticsCategorical Plots: boxplot, violinplot, and countplot
Relational Plots: scatterplot with hue & size mapping

Categorical Plots: boxplot, violinplot, and countplot

Intermediate6 min read•Updated: 2026-11-18•By Er. Sumit Kumar (MSK Institute)
Study MaterialsCheatsheet

1. Comparing Distributions Across Categorical Groups

To compare numerical distributions across discrete categories, Seaborn provides:

  • sns.boxplot(): Shows the 5-number statistical summary (Min, Q1, Median, Q3, Max) and identifies outliers.
  • sns.violinplot(): Combines a box plot with a rotated kernel density curve to reveal multimodal shapes.
  • sns.countplot(): Displays frequency counts for categorical variables (like an automated value_counts()).

2. Anatomy of a Box Plot

A Box Plot (Box-and-Whisker) provides 5 key metrics:

  1. 1
    Median (Q2 / 50th percentile): The central line inside the box.
  2. 2
    First Quartile (Q1 / 25th percentile): Bottom of the box.
  3. 3
    Third Quartile (Q3 / 75th percentile): Top of the box.
  4. 4
    Interquartile Range (IQR): $IQR = Q3 - Q1$ (the middle 50% of the data).
  5. 5
    Whiskers: Extend to $1.5 imes IQR$ from Q1 and Q3. Points beyond whiskers are plotted as individual outlier markers!
1import seaborn as sns
2import matplotlib.pyplot as plt
3 
4df = sns.load_dataset('tips')
5 
6fig, axes = plt.subplots(1, 2, figsize=(12, 5))
7 
8# 1. Box Plot with Outliers
9sns.boxplot(data=df, x='day', y='total_bill', palette='Set2', ax=axes[0])
10axes[0].set_title('Total Bill by Day (Box Plot)')
11 
12# 2. Violin Plot (Shows Bimodal Peaks)
13sns.violinplot(data=df, x='day', y='total_bill', palette='Set2', inner='quartile', ax=axes[1])
14axes[1].set_title('Total Bill Density by Day (Violin Plot)')
15 
16plt.show()

Interactive Quiz• Knowledge Check

Practice Quiz

Question 1
In a standard Tukey Box Plot, how is the Interquartile Range (IQR) calculated?
Question 2
In a box plot, data points that lie beyond which threshold are marked as outliers?
Question 3
What unique insight does a Violin Plot show that a standard Box Plot conceals?
Question 4
Which Seaborn function plots the frequency count of each categorical value without requiring pre-aggregation?
Question 5
What does the central line inside a box plot's rectangular box represent?

Next Lesson

Relational Plots: scatterplot with hue & size mapping

Continue learning with hands-on practice, examples, and exercises in the upcoming topic.

Related Lessons

Previous LessonNext Lesson
Distribution Plots: histplot, kdeplot, and ecdfplotRelational Plots: scatterplot with hue & size mapping

Practice Quiz

Test your understanding of this lesson with 5 questions. Each question has one correct answer.

12-Month Data Analysis Mastery Program

Master Full-Stack Data Analytics (Excel, SQL, Python, Power BI & Tableau)

Combine 15 complete courses, 150 chapters, 541 topics, live SQL/Power BI/Tableau dashboards, and Scikit-Learn capstones at MSK Institute Shikohabad or Live Online.

View Full CourseBook Free Demo
PreviousNext
PreviousPrevNext