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
Matplotlib Anatomy: Figure, Axes, Subplots & Ticks0%
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
2.1Matplotlib Anatomy: Figure, Axes, Subplots & Ticks2.2Line Plots, Markers, Line Styles & Multiple Series2.3Bar Charts, Horizontal Bars & Stacked Bars2.4Histograms, Bins & Probability Density
HomeTutorialsData Visualization & Applied StatisticsMatplotlib Anatomy: Figure, Axes, Subplots & Ticks
Line Plots, Markers, Line Styles & Multiple Series

Matplotlib Anatomy: Figure, Axes, Subplots & Ticks

Intermediate6 min read•Updated: 2026-11-18•By Er. Sumit Kumar (MSK Institute)
Study MaterialsCheatsheet
Matplotlib Figure AnatomyClick to Zoom
Matplotlib Figure Anatomy

1. Object-Oriented (OO) API vs Pyplot State-Machine

Matplotlib has two interfaces:

  1. 1
    The Pyplot State-Machine (plt.plot()): Implicit, MATLAB-like. Quick for throwaway scripts, but confusing for complex layouts.
  2. 2
    The Object-Oriented API (fig, ax = plt.subplots()): Explicit, clean, professional. You hold direct references to the Figure (the canvas) and Axes (the plot).

2. The Core Anatomy of a Plot

  • Figure: The top-level bounding window holding all subplots, titles, and legends.
  • Axes: The actual coordinate plotting area with an x-axis and y-axis.
  • Axis / Ticks: The scales with major and minor tick markers and labels.
  • Spines: The 4 boundary lines enclosing the plotting area (top, bottom, left, right).
1import matplotlib.pyplot as plt
2 
3fig, ax = plt.subplots(figsize=(8, 5))
4ax.plot([1, 2, 3, 4], [10, 25, 20, 35], color='#2563eb', linewidth=2.5, marker='o')
5 
6ax.set_title('Monthly Performance Metric', fontsize=14, fontweight='bold')
7ax.set_xlabel('Quarter')
8ax.set_ylabel('Profit (in Lakhs)')
9ax.spines['top'].set_visible(False)
10ax.spines['right'].set_visible(False)
11 
12plt.show()

Interactive Quiz• Knowledge Check

Practice Quiz

Question 1
In Matplotlib's Object-Oriented API, what does fig represent?
Question 2
What is an Axes object in Matplotlib?
Question 3
How do you create a 2x2 grid of subplots using Matplotlib's OO interface?
Question 4
How do you remove the top and right enclosing borders (spines) from a chart for a clean modern aesthetic?
Question 5
Why is the Object-Oriented interface preferred over plt.plot() for production dashboards?

Next Lesson

Line Plots, Markers, Line Styles & Multiple Series

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

Related Lessons

Previous LessonNext Lesson
Setting Up Jupyter, Inline Plotting & Figure SizingLine Plots, Markers, Line Styles & Multiple Series

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