Examples#

For an overview of the plotting methods we provide, see Plot types

This page contains example plots. Click on any image to see the full image and source code.

For longer tutorials, see our tutorials page. You can also find external resources and a FAQ in our user guide.

Tagging!

You can also browse the example gallery by tags.

Lines, bars and markers#

BERJAYA

Infinite lines

Infinite lines
BERJAYA

Bar chart with individual bar colors

Bar chart with individual bar colors
BERJAYA

Bar chart with labels

Bar chart with labels
BERJAYA

Stacked bar chart

Stacked bar chart
BERJAYA

Grouped bar chart with labels

Grouped bar chart with labels
BERJAYA

Horizontal bar chart

Horizontal bar chart
BERJAYA

Broken horizontal bars

Broken horizontal bars
BERJAYA

CapStyle

CapStyle
BERJAYA

Plotting categorical variables

Plotting categorical variables
BERJAYA

Plotting the coherence of two signals

Plotting the coherence of two signals
BERJAYA

Cross spectral density (CSD)

Cross spectral density (CSD)
BERJAYA

Curve with error band

Curve with error band
BERJAYA

Errorbar limit selection

Errorbar limit selection
BERJAYA

Errorbar subsampling

Errorbar subsampling
BERJAYA

EventCollection Demo

EventCollection Demo
BERJAYA

Eventplot demo

Eventplot demo
BERJAYA

Filled polygon

Filled polygon
BERJAYA

fill_between with transparency

fill_between with transparency
BERJAYA

Fill the area between two lines

Fill the area between two lines
BERJAYA

Fill the area between two vertical lines

Fill the area between two vertical lines
BERJAYA

Bar chart with gradients

Bar chart with gradients
BERJAYA

Hat graph

Hat graph
BERJAYA

Discrete distribution as horizontal bar chart

Discrete distribution as horizontal bar chart
BERJAYA

JoinStyle

JoinStyle
BERJAYA

Dashed line style configuration

Dashed line style configuration
BERJAYA

Lines with a ticked patheffect

Lines with a ticked patheffect
BERJAYA

Linestyles

Linestyles
BERJAYA

Marker reference

Marker reference
BERJAYA

Markevery Demo

Markevery Demo
BERJAYA

Plotting masked and NaN values

Plotting masked and NaN values
BERJAYA

Multicolored lines

Multicolored lines
BERJAYA

Mapping marker properties to multivariate data

Mapping marker properties to multivariate data
BERJAYA

Power spectral density (PSD)

Power spectral density (PSD)
BERJAYA

Scatter Demo2

Scatter Demo2
BERJAYA

Scatter plot with histograms

Scatter plot with histograms
BERJAYA

Scatter plot with masked values

Scatter plot with masked values
BERJAYA

Marker examples

Marker examples
BERJAYA

Scatter plot with a legend

Scatter plot with a legend
BERJAYA

Line plot

Line plot
BERJAYA

Shade regions defined by a logical mask using fill_between

Shade regions defined by a logical mask using fill_between
BERJAYA

Spectrum representations

Spectrum representations
BERJAYA

Stackplots and streamgraphs

Stackplots and streamgraphs
BERJAYA

Stairs Demo

Stairs Demo
BERJAYA

Stem plot

Stem plot
BERJAYA

Step Demo

Step Demo
BERJAYA

Timeline with lines, dates, and text

Timeline with lines, dates, and text
BERJAYA

hlines and vlines

hlines and vlines
BERJAYA

Cross- and auto-correlation

Cross- and auto-correlation

Images, contours and fields#

BERJAYA

Affine transform of an image

Affine transform of an image
BERJAYA

Wind barbs

Wind barbs
BERJAYA

Barcode

Barcode
BERJAYA

Interactive adjustment of colormap range

Interactive adjustment of colormap range
BERJAYA

Colormap normalizations

Colormap normalizations
BERJAYA

Colormap normalizations SymLogNorm

Colormap normalizations SymLogNorm
BERJAYA

Contour corner mask

Contour corner mask
BERJAYA

Contour Demo

Contour Demo
BERJAYA

Contour image

Contour image
BERJAYA

Contour Label Demo

Contour Label Demo
BERJAYA

Contourf demo

Contourf demo
BERJAYA

Contourf hatching

Contourf hatching
BERJAYA

Contourf and log color scale

Contourf and log color scale
BERJAYA

Contouring the solution space of optimizations

Contouring the solution space of optimizations
BERJAYA

BboxImage Demo

BboxImage Demo
BERJAYA

Figimage Demo

Figimage Demo
BERJAYA

Annotated heatmap

Annotated heatmap
BERJAYA

Image resampling

Image resampling
BERJAYA

Clipping images with patches

Clipping images with patches
BERJAYA

Many ways to plot images

Many ways to plot images
BERJAYA

Image with masked values

Image with masked values
BERJAYA

Image nonuniform

Image nonuniform
BERJAYA

Blend transparency with color in 2D images

Blend transparency with color in 2D images
BERJAYA

Modifying the coordinate formatter

Modifying the coordinate formatter
BERJAYA

Interpolations for imshow

Interpolations for imshow
BERJAYA

Contour plot of irregularly spaced data

Contour plot of irregularly spaced data
BERJAYA

Layer images with alpha blending

Layer images with alpha blending
BERJAYA

Visualize matrices with matshow

Visualize matrices with matshow
BERJAYA

Multiple images with one colorbar

Multiple images with one colorbar
BERJAYA

pcolor images

pcolor images
BERJAYA

pcolormesh grids and shading

pcolormesh grids and shading
BERJAYA

pcolormesh

pcolormesh
BERJAYA

Streamplot

Streamplot
BERJAYA

QuadMesh Demo

QuadMesh Demo
BERJAYA

Advanced quiver and quiverkey functions

Advanced quiver and quiverkey functions
BERJAYA

Quiver Simple Demo

Quiver Simple Demo
BERJAYA

Shading example

Shading example
BERJAYA

Spectrogram

Spectrogram
BERJAYA

Spy Demos

Spy Demos
BERJAYA

Tricontour Demo

Tricontour Demo
BERJAYA

Tricontour Smooth Delaunay

Tricontour Smooth Delaunay
BERJAYA

Tricontour Smooth User

Tricontour Smooth User
BERJAYA

Trigradient Demo

Trigradient Demo
BERJAYA

Triinterp Demo

Triinterp Demo
BERJAYA

Tripcolor Demo

Tripcolor Demo
BERJAYA

Triplot Demo

Triplot Demo
BERJAYA

Watermark image

Watermark image

Subplots, axes and figures#

BERJAYA

Align labels and titles

Align labels and titles
BERJAYA

Programmatically control subplot adjustment

Programmatically control subplot adjustment
BERJAYA

Axes box aspect

Axes box aspect
BERJAYA

Axes Demo

Axes Demo
BERJAYA

Controlling view limits using margins and sticky_edges

Controlling view limits using margins and sticky_edges
BERJAYA

Axes properties

Axes properties
BERJAYA

Axes zoom effect

Axes zoom effect
BERJAYA

Draw regions that span an Axes

Draw regions that span an Axes
BERJAYA

Equal axis aspect ratio

Equal axis aspect ratio
BERJAYA

Axis label position

Axis label position
BERJAYA

Broken axis

Broken axis
BERJAYA

Custom Figure subclasses

Custom Figure subclasses
BERJAYA

Resize Axes with constrained layout

Resize Axes with constrained layout
BERJAYA

Resize Axes with tight layout

Resize Axes with tight layout
BERJAYA

Different scales on the same Axes

Different scales on the same Axes
BERJAYA

Figure size in different units

Figure size in different units
BERJAYA

Figure labels: suptitle, supxlabel, supylabel

Figure labels: suptitle, supxlabel, supylabel
BERJAYA

Adjacent subplots

Adjacent subplots
BERJAYA

Geographic Projections

Geographic Projections
BERJAYA

Combine two subplots using subplots and GridSpec

Combine two subplots using subplots and GridSpec
BERJAYA

GridSpec with variable sizes and spacing

GridSpec with variable sizes and spacing
BERJAYA

Gridspec for multi-column/row subplot layouts

Gridspec for multi-column/row subplot layouts
BERJAYA

Nested Gridspecs

Nested Gridspecs
BERJAYA

Inverted axis

Inverted axis
BERJAYA

Manage multiple figures in pyplot

Manage multiple figures in pyplot
BERJAYA

Secondary Axis

Secondary Axis
BERJAYA

Share axis limits and views

Share axis limits and views
BERJAYA

Shared axis

Shared axis
BERJAYA

Figure subfigures

Figure subfigures
BERJAYA

Multiple subplots

Multiple subplots
BERJAYA

subplot2grid

subplot2grid
BERJAYA

Subplots spacings and margins

Subplots spacings and margins
BERJAYA

Create multiple subplots using plt.subplots

Create multiple subplots using plt.subplots
BERJAYA

Plots with different scales

Plots with different scales
BERJAYA

Zoom region inset Axes

Zoom region inset Axes

Statistics#

BERJAYA

Artist customization in box plots

Artist customization in box plots
BERJAYA

Box plots with custom fill colors

Box plots with custom fill colors
BERJAYA

Boxplots

Boxplots
BERJAYA

Box plot vs. violin plot comparison

Box plot vs. violin plot comparison
BERJAYA

Separate calculation and plotting of boxplots

Separate calculation and plotting of boxplots
BERJAYA

Plot a confidence ellipse of a two-dimensional dataset

Plot a confidence ellipse of a two-dimensional dataset
BERJAYA

Violin plot customization

Violin plot customization
BERJAYA

Errorbar function

Errorbar function
BERJAYA

Different ways of specifying error bars

Different ways of specifying error bars
BERJAYA

Including upper and lower limits in error bars

Including upper and lower limits in error bars
BERJAYA

Create boxes from error bars using PatchCollection

Create boxes from error bars using PatchCollection
BERJAYA

Hexagonal binned plot

Hexagonal binned plot
BERJAYA

Histograms

Histograms
BERJAYA

Bihistogram

Bihistogram
BERJAYA

Cumulative distributions

Cumulative distributions
BERJAYA

Demo of the histogram function's different histtype settings

Demo of the histogram function's different histtype settings
BERJAYA

The histogram (hist) function with multiple data sets

The histogram (hist) function with multiple data sets
BERJAYA

Histogram bins, density, and weight

Histogram bins, density, and weight
BERJAYA

Multiple histograms side by side

Multiple histograms side by side
BERJAYA

Time Series Histogram

Time Series Histogram
BERJAYA

Violin plot basics

Violin plot basics

Pie and polar charts#

BERJAYA

Pie charts

Pie charts
BERJAYA

Bar of pie

Bar of pie
BERJAYA

Nested pie charts

Nested pie charts
BERJAYA

A pie and a donut with labels

A pie and a donut with labels
BERJAYA

Bar chart on polar axis

Bar chart on polar axis
BERJAYA

Polar plot

Polar plot
BERJAYA

Error bar rendering on polar axis

Error bar rendering on polar axis
BERJAYA

Polar legend

Polar legend
BERJAYA

Scatter plot on polar axis

Scatter plot on polar axis

Text, labels and annotations#

BERJAYA

Accented text

Accented text
BERJAYA

Align y-labels

Align y-labels
BERJAYA

Scale invariant angle label

Scale invariant angle label
BERJAYA

Angle annotations on bracket arrows

Angle annotations on bracket arrows
BERJAYA

Annotate transform

Annotate transform
BERJAYA

Annotating a plot

Annotating a plot
BERJAYA

Annotate plots

Annotate plots
BERJAYA

Annotate polar plots

Annotate polar plots
BERJAYA

Arrow Demo

Arrow Demo
BERJAYA

Auto-wrap text

Auto-wrap text
BERJAYA

Compose custom legends

Compose custom legends
BERJAYA

Date tick labels

Date tick labels
BERJAYA

AnnotationBbox demo

AnnotationBbox demo
BERJAYA

Using a text as a Path

Using a text as a Path
BERJAYA

Text rotation mode

Text rotation mode
BERJAYA

The difference between \dfrac and \frac

The difference between \dfrac and \frac
BERJAYA

Format ticks using engineering notation

Format ticks using engineering notation
BERJAYA

Annotation arrow style reference

Annotation arrow style reference
BERJAYA

Styling text boxes

Styling text boxes
BERJAYA

Figure legend demo

Figure legend demo
BERJAYA

Configure the font family

Configure the font family
BERJAYA

Using ttf font files

Using ttf font files
BERJAYA

Font table

Font table
BERJAYA

Fonts demo (object-oriented style)

Fonts demo (object-oriented style)
BERJAYA

Fonts demo (keyword arguments)

Fonts demo (keyword arguments)
BERJAYA

Labelling subplots

Labelling subplots
BERJAYA

Legend using pre-defined labels

Legend using pre-defined labels
BERJAYA

Legend Demo

Legend Demo
BERJAYA

Artist within an artist

Artist within an artist
BERJAYA

Convert texts to images

Convert texts to images
BERJAYA

Mathtext

Mathtext
BERJAYA

Mathematical expressions

Mathematical expressions
BERJAYA

Math fontfamily

Math fontfamily
BERJAYA

Multiline

Multiline
BERJAYA

Placing text boxes

Placing text boxes
BERJAYA

Concatenate text objects with different properties

Concatenate text objects with different properties
BERJAYA

STIX Fonts

STIX Fonts
BERJAYA

Render math equations using TeX

Render math equations using TeX
BERJAYA

Text alignment

Text alignment
BERJAYA

Text properties

Text properties
BERJAYA

Controlling style of text and labels using a dictionary

Controlling style of text and labels using a dictionary
BERJAYA

Text rotation angle in data coordinates

Text rotation angle in data coordinates
BERJAYA

Title positioning

Title positioning
BERJAYA

Unicode minus

Unicode minus
BERJAYA

Usetex text baseline

Usetex text baseline
BERJAYA

Usetex font effects

Usetex font effects
BERJAYA

Text watermark

Text watermark

Color#

For a description of the colormaps available in Matplotlib, see the colormaps tutorial.

BERJAYA

Color Demo

Color Demo
BERJAYA

Color by y-value

Color by y-value
BERJAYA

Colors in the default property cycle

Colors in the default property cycle
BERJAYA

Named color sequences

Named color sequences
BERJAYA

Colorbar

Colorbar
BERJAYA

Colormap reference

Colormap reference
BERJAYA

Create a colormap from a list of colors

Create a colormap from a list of colors
BERJAYA

Selecting individual colors from a colormap

Selecting individual colors from a colormap
BERJAYA

List of named colors

List of named colors
BERJAYA

Ways to set a color's alpha value

Ways to set a color's alpha value

Shapes and collections#

BERJAYA

Arrow guide

Arrow guide
BERJAYA

Reference for Matplotlib artists

Reference for Matplotlib artists
BERJAYA

Line, Poly and RegularPoly Collection with autoscaling

Line, Poly and RegularPoly Collection with autoscaling
BERJAYA

Compound path

Compound path
BERJAYA

Dolphins

Dolphins
BERJAYA

Mmh Donuts!!!

Mmh Donuts!!!
BERJAYA

Ellipse with orientation arrow demo

Ellipse with orientation arrow demo
BERJAYA

Ellipse Collection

Ellipse Collection
BERJAYA

Ellipse Demo

Ellipse Demo
BERJAYA

Drawing fancy boxes

Drawing fancy boxes
BERJAYA

Hatch demo

Hatch demo
BERJAYA

Hatch style reference

Hatch style reference
BERJAYA

Plot multiple lines using a LineCollection

Plot multiple lines using a LineCollection
BERJAYA

Circles, Wedges and Polygons

Circles, Wedges and Polygons
BERJAYA

PathPatch object

PathPatch object
BERJAYA

Bezier curve

Bezier curve
BERJAYA

Scatter plot

Scatter plot

Style sheets#

BERJAYA

Bayesian Methods for Hackers style sheet

Bayesian Methods for Hackers style sheet
BERJAYA

Dark background style sheet

Dark background style sheet
BERJAYA

FiveThirtyEight style sheet

FiveThirtyEight style sheet
BERJAYA

ggplot style sheet

ggplot style sheet
BERJAYA

Grayscale style sheet

Grayscale style sheet
BERJAYA

Petroff10 style sheet

Petroff10 style sheet
BERJAYA

Solarized Light stylesheet

Solarized Light stylesheet
BERJAYA

Style sheets reference

Style sheets reference

Module - pyplot#

BERJAYA

Simple plot

Simple plot
BERJAYA

Text and mathtext using pyplot

Text and mathtext using pyplot
BERJAYA

Multiple lines using pyplot

Multiple lines using pyplot
BERJAYA

Two subplots using pyplot

Two subplots using pyplot

Module - axes_grid1#

BERJAYA

Anchored Direction Arrow

Anchored Direction Arrow
BERJAYA

Axes divider

Axes divider
BERJAYA

Demo Axes Grid

Demo Axes Grid
BERJAYA

Axes Grid2

Axes Grid2
BERJAYA

HBoxDivider and VBoxDivider demo

HBoxDivider and VBoxDivider demo
BERJAYA

Show RGB channels using RGBAxes

Show RGB channels using RGBAxes
BERJAYA

Colorbar with AxesDivider

Colorbar with AxesDivider
BERJAYA

Control the position and size of a colorbar with Inset Axes

Control the position and size of a colorbar with Inset Axes
BERJAYA

Per-row or per-column colorbars

Per-row or per-column colorbars
BERJAYA

Axes with a fixed physical size

Axes with a fixed physical size
BERJAYA

ImageGrid cells with a fixed aspect ratio

ImageGrid cells with a fixed aspect ratio
BERJAYA

Inset locator demo

Inset locator demo
BERJAYA

Inset locator demo 2

Inset locator demo 2
BERJAYA

Make room for ylabel using axes_grid

Make room for ylabel using axes_grid
BERJAYA

Parasite Simple

Parasite Simple
BERJAYA

Parasite Simple2

Parasite Simple2
BERJAYA

Align histogram to scatter plot using locatable Axes

Align histogram to scatter plot using locatable Axes
BERJAYA

Simple Anchored Artists

Simple Anchored Artists
BERJAYA

Simple Axes Divider 1

Simple Axes Divider 1
BERJAYA

Simple axes divider 3

Simple axes divider 3
BERJAYA

Simple ImageGrid

Simple ImageGrid
BERJAYA

Simple ImageGrid 2

Simple ImageGrid 2
BERJAYA

Simple Axisline4

Simple Axisline4

Module - axisartist#

BERJAYA

Axis Direction

Axis Direction
BERJAYA

axis_direction demo

axis_direction demo
BERJAYA

Axis line styles

Axis line styles
BERJAYA

Curvilinear grid demo

Curvilinear grid demo
BERJAYA

Demo CurveLinear Grid2

Demo CurveLinear Grid2
BERJAYA

floating_axes features

floating_axes features
BERJAYA

floating_axis demo

floating_axis demo
BERJAYA

Parasite Axes demo

Parasite Axes demo
BERJAYA

Parasite axis demo

Parasite axis demo
BERJAYA

Ticklabel alignment

Ticklabel alignment
BERJAYA

Ticklabel direction

Ticklabel direction
BERJAYA

Simple axis direction

Simple axis direction
BERJAYA

Simple axis tick label and tick directions

Simple axis tick label and tick directions
BERJAYA

Simple axis pad

Simple axis pad
BERJAYA

Custom spines with axisartist

Custom spines with axisartist
BERJAYA

Simple Axisline

Simple Axisline
BERJAYA

Simple Axisline3

Simple Axisline3

Showcase#

BERJAYA

Anatomy of a figure

Anatomy of a figure
BERJAYA

Firefox

Firefox
BERJAYA

Integral as the area under a curve

Integral as the area under a curve
BERJAYA

Shaded & power normalized rendering

Shaded & power normalized rendering
BERJAYA

Pan/zoom events of overlapping axes

Pan/zoom events of overlapping axes
BERJAYA

Stock prices over 32 years

Stock prices over 32 years
BERJAYA

XKCD

XKCD

Animation#

BERJAYA

Decay

Decay
BERJAYA

Animated histogram

Animated histogram
BERJAYA

pyplot animation

pyplot animation
BERJAYA

The Bayes update

The Bayes update
BERJAYA

The double pendulum problem

The double pendulum problem
BERJAYA

Animated image using a precomputed list of images

Animated image using a precomputed list of images
BERJAYA

Frame grabbing

Frame grabbing
BERJAYA

Multiple Axes animation

Multiple Axes animation
BERJAYA

Pause and resume an animation

Pause and resume an animation
BERJAYA

Rain simulation

Rain simulation
BERJAYA

Animated 3D random walk

Animated 3D random walk
BERJAYA

Animated line plot

Animated line plot
BERJAYA

Animated scatter saved as GIF

Animated scatter saved as GIF
BERJAYA

Oscilloscope

Oscilloscope
BERJAYA

Matplotlib unchained

Matplotlib unchained

Event handling#

Matplotlib supports event handling with a GUI neutral event model, so you can connect to Matplotlib events without knowledge of what user interface Matplotlib will ultimately be plugged in to. This has two advantages: the code you write will be more portable, and Matplotlib events are aware of things like data coordinate space and which axes the event occurs in so you don't have to mess with low level transformation details to go from canvas space to data space. Object picking examples are also included.

BERJAYA

Close event

Close event
BERJAYA

Mouse move and click events

Mouse move and click events
BERJAYA

Cross-hair cursor

Cross-hair cursor
BERJAYA

Data browser

Data browser
BERJAYA

Figure/Axes enter and leave events

Figure/Axes enter and leave events
BERJAYA

Interactive functions

Interactive functions
BERJAYA

Scroll event

Scroll event
BERJAYA

Keypress event

Keypress event
BERJAYA

Lasso Demo

Lasso Demo
BERJAYA

Legend picking

Legend picking
BERJAYA

Looking glass

Looking glass
BERJAYA

Path editor

Path editor
BERJAYA

Pick event demo

Pick event demo
BERJAYA

Pick event demo 2

Pick event demo 2
BERJAYA

Polygon editor

Polygon editor
BERJAYA

Pong

Pong
BERJAYA

Resampling Data

Resampling Data
BERJAYA

Timers

Timers
BERJAYA

Trifinder Event Demo

Trifinder Event Demo
BERJAYA

Viewlims

Viewlims
BERJAYA

Zoom modifies other Axes

Zoom modifies other Axes

Miscellaneous#

BERJAYA

Anchored Artists

Anchored Artists
BERJAYA

Identify whether artists intersect

Identify whether artists intersect
BERJAYA

Manual Contour

Manual Contour
BERJAYA

Coords Report

Coords Report
BERJAYA

Custom projection

Custom projection
BERJAYA

Customize Rc

Customize Rc
BERJAYA

AGG filter

AGG filter
BERJAYA

Ribbon box

Ribbon box
BERJAYA

Add lines directly to a figure

Add lines directly to a figure
BERJAYA

Fill spiral

Fill spiral
BERJAYA

Findobj Demo

Findobj Demo
BERJAYA

Font indexing

Font indexing
BERJAYA

Font properties

Font properties
BERJAYA

Building histograms using Rectangles and PolyCollections

Building histograms using Rectangles and PolyCollections
BERJAYA

Hyperlinks

Hyperlinks
BERJAYA

Image thumbnail

Image thumbnail
BERJAYA

Plotting with keywords

Plotting with keywords
BERJAYA

Matplotlib logo

Matplotlib logo
BERJAYA

Multipage PDF

Multipage PDF
BERJAYA

Multiprocessing

Multiprocessing
BERJAYA

Packed-bubble chart

Packed-bubble chart
BERJAYA

Patheffect Demo

Patheffect Demo
BERJAYA

Print image to stdout

Print image to stdout
BERJAYA

Rasterization for vector graphics

Rasterization for vector graphics
BERJAYA

Set and get properties

Set and get properties
BERJAYA

Apply SVG filter to a line

Apply SVG filter to a line
BERJAYA

SVG filter pie

SVG filter pie
BERJAYA

Table Demo

Table Demo
BERJAYA

TickedStroke patheffect

TickedStroke patheffect
BERJAYA

transforms.offset_copy

transforms.offset_copy
BERJAYA

Zorder Demo

Zorder Demo

3D plotting#

BERJAYA

Plot 2D data on 3D plot

Plot 2D data on 3D plot
BERJAYA

Demo of 3D bar charts

Demo of 3D bar charts
BERJAYA

Clip the data to the axes view limits

Clip the data to the axes view limits
BERJAYA

Create 2D bar graphs in different planes

Create 2D bar graphs in different planes
BERJAYA

3D box surface plot

3D box surface plot
BERJAYA

Plot contour (level) curves in 3D

Plot contour (level) curves in 3D
BERJAYA

Plot contour (level) curves in 3D using the extend3d option

Plot contour (level) curves in 3D using the extend3d option
BERJAYA

Project contour profiles onto a graph

Project contour profiles onto a graph
BERJAYA

Filled contours

Filled contours
BERJAYA

Project filled contour onto a graph

Project filled contour onto a graph
BERJAYA

Custom hillshading in a 3D surface plot

Custom hillshading in a 3D surface plot
BERJAYA

3D errorbars

3D errorbars
BERJAYA

Fill between 3D lines

Fill between 3D lines
BERJAYA

Fill under 3D line graphs

Fill under 3D line graphs
BERJAYA

Create 3D histogram of 2D data

Create 3D histogram of 2D data
BERJAYA

2D images in 3D

2D images in 3D
BERJAYA

Intersecting planes

Intersecting planes
BERJAYA

Parametric curve

Parametric curve
BERJAYA

Lorenz attractor

Lorenz attractor
BERJAYA

2D and 3D Axes in same figure

2D and 3D Axes in same figure
BERJAYA

Automatic text offsetting

Automatic text offsetting
BERJAYA

Draw flat objects in 3D plot

Draw flat objects in 3D plot
BERJAYA

Generate 3D polygons

Generate 3D polygons
BERJAYA

3D plot projection types

3D plot projection types
BERJAYA

3D quiver plot

3D quiver plot
BERJAYA

Rotating a 3D plot

Rotating a 3D plot
BERJAYA

3D scatterplot

3D scatterplot
BERJAYA

3D stem

3D stem
BERJAYA

3D plots as subplots

3D plots as subplots
BERJAYA

3D surface (colormap)

3D surface (colormap)
BERJAYA

3D surface (solid color)

3D surface (solid color)
BERJAYA

3D surface (checkerboard)

3D surface (checkerboard)
BERJAYA

3D surface with polar coordinates

3D surface with polar coordinates
BERJAYA

Text annotations in 3D

Text annotations in 3D
BERJAYA

Triangular 3D contour plot

Triangular 3D contour plot
BERJAYA

Triangular 3D filled contour plot

Triangular 3D filled contour plot
BERJAYA

Triangular 3D surfaces

Triangular 3D surfaces
BERJAYA

More triangular 3D surfaces

More triangular 3D surfaces
BERJAYA

Primary 3D view planes

Primary 3D view planes
BERJAYA

3D voxel / volumetric plot

3D voxel / volumetric plot
BERJAYA

3D voxel plot of the NumPy logo

3D voxel plot of the NumPy logo
BERJAYA

3D voxel / volumetric plot with RGB colors

3D voxel / volumetric plot with RGB colors
BERJAYA

3D voxel / volumetric plot with cylindrical coordinates

3D voxel / volumetric plot with cylindrical coordinates
BERJAYA

3D wireframe plot

3D wireframe plot
BERJAYA

Animate a 3D wireframe plot

Animate a 3D wireframe plot
BERJAYA

3D wireframe plots in one direction

3D wireframe plots in one direction

Scales#

These examples cover how different scales are handled in Matplotlib.

BERJAYA

Scales overview

Scales overview
BERJAYA

Asinh scale

Asinh scale
BERJAYA

Loglog aspect

Loglog aspect
BERJAYA

Custom scale

Custom scale
BERJAYA

Log scale

Log scale
BERJAYA

Logit scale

Logit scale
BERJAYA

Exploring normalizations

Exploring normalizations
BERJAYA

Symlog scale

Symlog scale

Specialty plots#

BERJAYA

Hillshading

Hillshading
BERJAYA

Anscombe's quartet

Anscombe's quartet
BERJAYA

Hinton diagrams

Hinton diagrams
BERJAYA

Ishikawa Diagram

Ishikawa Diagram
BERJAYA

Left ventricle bullseye

Left ventricle bullseye
BERJAYA

MRI with EEG

MRI with EEG
BERJAYA

Radar chart (aka spider or star chart)

Radar chart (aka spider or star chart)
BERJAYA

The Sankey class

The Sankey class
BERJAYA

Long chain of connections using Sankey

Long chain of connections using Sankey
BERJAYA

Rankine power cycle

Rankine power cycle
BERJAYA

SkewT-logP diagram: using transforms and custom projections

SkewT-logP diagram: using transforms and custom projections
BERJAYA

Topographic hillshading

Topographic hillshading

Spines#

BERJAYA

Spines

Spines
BERJAYA

Spine placement

Spine placement
BERJAYA

Dropped spines

Dropped spines
BERJAYA

Multiple y-axis with Spines

Multiple y-axis with Spines
BERJAYA

Centered spines with arrows

Centered spines with arrows

Ticks#

BERJAYA

Align tick labels

Align tick labels
BERJAYA

Automatically setting tick positions

Automatically setting tick positions
BERJAYA

Center labels between ticks

Center labels between ticks
BERJAYA

Colorbar Tick Labelling

Colorbar Tick Labelling
BERJAYA

Custom Ticker

Custom Ticker
BERJAYA

Format date ticks using ConciseDateFormatter

Format date ticks using ConciseDateFormatter
BERJAYA

Date Demo Convert

Date Demo Convert
BERJAYA

Placing date ticks using recurrence rules

Placing date ticks using recurrence rules
BERJAYA

Date tick locators and formatters

Date tick locators and formatters
BERJAYA

Custom tick formatter for time series

Custom tick formatter for time series
BERJAYA

Date precision and epochs

Date precision and epochs
BERJAYA

Dollar ticks

Dollar ticks
BERJAYA

SI prefixed offsets and natural order of magnitudes

SI prefixed offsets and natural order of magnitudes
BERJAYA

Fig Axes Customize Simple

Fig Axes Customize Simple
BERJAYA

Major and minor ticks

Major and minor ticks
BERJAYA

Multilevel (nested) ticks

Multilevel (nested) ticks
BERJAYA

The default tick formatter

The default tick formatter
BERJAYA

Tick formatters

Tick formatters
BERJAYA

Tick locators

Tick locators
BERJAYA

Set default y-axis tick labels on the right

Set default y-axis tick labels on the right
BERJAYA

Setting tick labels from a list of values

Setting tick labels from a list of values
BERJAYA

Move x-axis tick labels to the top

Move x-axis tick labels to the top
BERJAYA

Rotated tick labels

Rotated tick labels
BERJAYA

Fixing too many ticks

Fixing too many ticks

Units#

These examples cover the many representations of units in Matplotlib.

BERJAYA

Annotation with units

Annotation with units
BERJAYA

Artist tests

Artist tests
BERJAYA

Bar demo with units

Bar demo with units
BERJAYA

Group barchart with units

Group barchart with units
BERJAYA

Basic units

Basic units
BERJAYA

Ellipse with units

Ellipse with units
BERJAYA

Evans test

Evans test
BERJAYA

Radian ticks

Radian ticks
BERJAYA

Inches and centimeters

Inches and centimeters
BERJAYA

Unit handling

Unit handling

Embedding Matplotlib in graphical user interfaces#

You can embed Matplotlib directly into a user interface application by following the embedding_in_SOMEGUI.py examples here. Currently Matplotlib supports PyQt/PySide, PyGObject, Tkinter, and wxPython.

When embedding Matplotlib in a GUI, you must use the Matplotlib API directly rather than the pylab/pyplot procedural interface, so take a look at the examples/api directory for some example code working with the API.

BERJAYA

CanvasAgg demo

CanvasAgg demo
BERJAYA

Embed in GTK3 with a navigation toolbar

Embed in GTK3 with a navigation toolbar
BERJAYA

Embed in GTK3

Embed in GTK3
BERJAYA

Embed in GTK4 with a navigation toolbar

Embed in GTK4 with a navigation toolbar
BERJAYA

Embed in GTK4

Embed in GTK4
BERJAYA

Embed in Qt

Embed in Qt
BERJAYA

Embed in Tk

Embed in Tk
BERJAYA

Embed in wx #2

Embed in wx #2
BERJAYA

Embed in wx #3

Embed in wx #3
BERJAYA

Embed in wx #4

Embed in wx #4
BERJAYA

Embed in wx #5

Embed in wx #5
BERJAYA

Embedding WebAgg

Embedding WebAgg
BERJAYA

Fourier Demo WX

Fourier Demo WX
BERJAYA

GTK3 spreadsheet

GTK3 spreadsheet
BERJAYA

GTK4 spreadsheet

GTK4 spreadsheet
BERJAYA

Display mathtext in WX

Display mathtext in WX
BERJAYA

Matplotlib with Glade 3

Matplotlib with Glade 3
BERJAYA

mplcvd -- an example of figure hook

mplcvd -- an example of figure hook
BERJAYA

pyplot with GTK3

pyplot with GTK3
BERJAYA

pyplot with GTK4

pyplot with GTK4
BERJAYA

SVG Histogram

SVG Histogram
BERJAYA

SVG Tooltip

SVG Tooltip
BERJAYA

Tool Manager

Tool Manager
BERJAYA

Embed in a web application server (Flask)

Embed in a web application server (Flask)
BERJAYA

Add a cursor in WX

Add a cursor in WX

Widgets#

Examples of how to write primitive, but GUI agnostic, widgets in matplotlib

BERJAYA

Annotated cursor

Annotated cursor
BERJAYA

Buttons

Buttons
BERJAYA

Check buttons

Check buttons
BERJAYA

Cursor

Cursor
BERJAYA

Lasso Selector

Lasso Selector
BERJAYA

Menu

Menu
BERJAYA

Mouse Cursor

Mouse Cursor
BERJAYA

Multicursor

Multicursor
BERJAYA

Select indices from a collection using polygon selector

Select indices from a collection using polygon selector
BERJAYA

Polygon Selector

Polygon Selector
BERJAYA

Radio Buttons

Radio Buttons
BERJAYA

Image scaling using a RangeSlider

Image scaling using a RangeSlider
BERJAYA

Rectangle and ellipse selectors

Rectangle and ellipse selectors
BERJAYA

Slider

Slider
BERJAYA

Snap sliders to discrete values

Snap sliders to discrete values
BERJAYA

Span Selector

Span Selector
BERJAYA

Textbox

Textbox

Userdemo#

BERJAYA

Nested GridSpecs

Nested GridSpecs
BERJAYA

Simple Legend01

Simple Legend01
BERJAYA

Simple Legend02

Simple Legend02

Gallery generated by Sphinx-Gallery