0 / 50 Lessons Completed
Master 2D curves, statistical distributions, subplots, and 3D surface landscapes.
Anatomy of a Matplotlib Figure
Click any component on the visual diagram to inspect its role, hierarchy, and Python API code.
Figure (The Canvas)
The top-level container window holding all axes panels, suptitles, colorbars, and overall canvas dimensions.
fig, ax = plt.subplots(figsize=(8, 5))
plt.figure(figsize=(8, 5), dpi=100)
Dimensions are in physical inches, converted to pixels via DPI (Pixels = Inches * DPI).
50-Topic Master Curriculum
From beginner Pyplot basics to advanced 3D projections & executive dashboards
Matplotlib Introduction & Pyplot vs OO API
What is Matplotlib, how does the rendering pipeline work, and Pyplot vs Object-Oriented API?
Anatomy of a Matplotlib Figure
Understand Figure, Axes, Axis, Spines, Major/Minor Ticks, Labels, Legend, and Markers.
Basic Line Plots (plt.plot)
Plot continuous lines, handle single vs dual arguments, and understand coordinate mapping.
Line Styles, Widths & Formatting
Customize solid, dashed, dash-dot, and dotted lines, line thickness, and alpha transparency.
Markers & Data Points
Emphasize discrete observations using circle, square, triangle, and star markers.
Colors, Hex Codes & Named Palettes
Apply CSS color names, HEX codes, RGB/RGBA tuples, and understand color theory in data visualization.
Plot Labels, Titles & Typography
Add descriptive titles, axes labels, adjust font sizes, font weights, and alignments.
Grid Lines & Axis Limits (xlim / ylim)
Control chart boundaries with xlim/ylim, and format background coordinate grid lines.
Legends & Label Positioning
Tag data series with labels and render positioned legend boxes.
Multiple Lines & Overlays
Layer multiple lines, fill between curves, and create high-impact comparative charts.
Vertical & Horizontal Bar Charts
Compare discrete categories with plt.bar() and long category names with plt.barh().
Grouped & Stacked Bar Charts
Plot multi-category comparisons with offset X indices or the bottom parameter.
Histograms & Probability Distributions
Plot continuous frequency distributions, customize bin counts, and normalize probability density.
Scatter Plots, Sizing & Colormaps
Visualize correlations across 4 dimensions simultaneously using X, Y, point size (s), and color (c).
Pie Charts & Donut Charts
Display percentage breakdowns, slice explosion, percentage formatting, and donut center holes.
Box Plots & Statistical Outliers
Inspect 5-number summaries (Min, Q1, Median, Q3, Max) and Tukey IQR outlier points.
Violin Plots & Kernel Density
Combine boxplot summary metrics with full probability density curves.
Error Bars & Uncertainty Intervals
Quantify measurement noise, confidence intervals, and standard errors with plt.errorbar().
Area Charts & fill_between()
Shade regions between curves, confidence intervals, and cumulative volume charts.
Stackplots & Cumulative Area Streams
Track cumulative multi-series compositions over continuous time intervals with plt.stackplot().
Subplots with plt.subplot()
Create multi-panel figures using grid coordinates (nrows, ncols, index).
Object-Oriented Subplots (plt.subplots)
Master fig, axs = plt.subplots(nrows, ncols) and iterate over axes arrays cleanly.
Complex Grids with GridSpec
Design non-uniform dashboard layouts with spanning rows and columns using GridSpec.
Inset Axes & Mini Zoom Plots
Embed magnified sub-plots inside main axes to highlight critical micro-phenomena.
Twin Axes (twinx / twiny) for Dual Scales
Plot two metrics with different units (e.g. Temperature °C vs Rainfall mm) on the same X axis.
Shared X and Y Axes (sharex / sharey)
Synchronize pan, zoom, and tick scales across subplots automatically.
Figure Sizing, DPI & Aspect Ratios
Calculate pixel dimensions with figsize=(w, h) in inches and dpi (Dots Per Inch).
Spacing & Margin Control (tight_layout & subplots_adjust)
Eliminate label clipping and tune padding with tight_layout() and subplots_adjust().
Constrained Layout Engine
Use layout='constrained' for robust, dynamic subplot alignment.
Plotting with Pandas DataFrames (df.plot)
Harness pandas built-in matplotlib wrapper with df.plot() and ax integration.
Colormaps & Colorbars (Sequential vs Diverging)
Master perceptually uniform colormaps (viridis, plasma, coolwarm) and colorbar legends.
Normalization & Color Scaling (Normalize, LogNorm)
Scale skewed data with LogNorm and enforce explicit boundary limits (vmin, vmax).
Heatmaps & Matrix Display with imshow()
Display 2D matrices, correlation tables, and image tensors with plt.imshow().
2D Contour & Filled Contour Plots (contourf)
Plot topographical isolines and continuous gradient fields with contour() and contourf().
Spines Customization & Centered Axes
Position coordinate axes at origin (0, 0), hide borders, and create textbook math plots.
Custom Ticks, Locators & Formatters
Format currency ($), percentages (%), dates, and custom tick intervals.
Logarithmic & Symmetrical Scales (yscale('log'))
Plot exponential growth, power laws, and wide dynamic ranges with log scales.
Annotations, Arrows & Callouts (plt.annotate)
Direct viewer attention with callout text, pointers, and custom arrow styles.
Text Boxes & LaTeX Mathematical Equations
Render publication formulas (r'$\sigma = \sqrt{\frac{1}{N}\sum (x-\mu)^2}$') with Mathtext.
Polar Plots & Radar / Spider Charts
Plot angular theta and radius (r) coordinates, radar charts, and wind roses.
3D Surface Plots with Colormaps (plot_surface)
Render 3D surfaces ($Z = f(X, Y)$), lighting, elevation, azimuth, and color gradients.
3D Wireframes & 3D Scatter Clouds
Plot lightweight 3D wireframe grids and multidimensional scatter point clouds (scatter3D).
3D Bar Charts & Voxel Projections (bar3d)
Plot 3D volume pillars with width (dx), depth (dy), and height (dz).
Vector Fields, Quiver & Streamplots
Visualize directional velocity, gradients, wind currents, and fluid dynamics.
Built-in Stylesheets & Dark Themes (plt.style.use)
Apply pre-built publication themes (dark_background, seaborn, ggplot, fivethirtyeight).
Financial Charts: Candlestick & OHLC Price Action
Plot Open-High-Low-Close (OHLC) financial price candles, moving averages, and volume bars.
Time-Series & Date Formatting
Format real datetime indices, auto date locators, and periodic financial intervals.
High-Resolution Exporting (savefig, PDF, SVG, DPI)
Export publication figures with plt.savefig(), vector PDF/SVG, transparent backgrounds, and bbox_inches='tight'.
Interactive Visualizations & Animations (FuncAnimation)
Animate time-evolving simulations, live streaming sensor updates, and GIF exports.
Capstone Project: Comprehensive Analytics Dashboard
Build a production 4-panel executive analytics dashboard combining lines, bars, scatter, and distributions.
Explore the Free Interactive Playground
Experiment with 15+ pre-built templates, rotate 3D surfaces in real time, customize colormap gradients, and design multi-panel figure subplots.