matplotlib.pyplot.scatter   matplotlib.pyplot.scatter(x, y, s=None, c=None, marker=None, cmap=None, norm=None, vmin=None, vmax=None, alpha=None, linewidths=None, *, edgecolors=None, plotnonfinite=False, data=None, **kwargs)[source]

A scatter plot of y vs. x with varying marker size and/or color.  Parameters

x, yfloat or array-like, shape (n, )

The data positions.
sfloat or array-like, shape (n, ), optional

The marker size in points**2. Default is rcParams['lines.markersize'] ** 2.
carray-like or list of colors or color, optional

The marker colors. Possible values:  A scalar or sequence of n numbers to be mapped to colors using cmap and norm. A 2D array in which the rows are RGB or RGBA. A sequence of colors of length n. A single color format string.  Note that c should not be a single numeric RGB or RGBA sequence because that is indistinguishable from an array of values to be colormapped. If you want to specify the same RGB or RGBA value for all points, use a 2D array with a single row. Otherwise, value- matching will have precedence in case of a size matching with x and y. If you wish to specify a single color for all points prefer the color keyword argument. Defaults to None. In that case the marker color is determined by the value of color, facecolor or facecolors. In case those are not specified or None, the marker color is determined by the next color of the Axes' current "shape and fill" color cycle. This cycle defaults to rcParams["axes.prop_cycle"] (default: cycler('color', ['#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd', '#8c564b', '#e377c2', '#7f7f7f', '#bcbd22', '#17becf'])).
markerMarkerStyle, default: rcParams["scatter.marker"] (default: 'o')

The marker style. marker can be either an instance of the class or the text shorthand for a particular marker. See matplotlib.markers for more information about marker styles.
cmapstr or Colormap, default: rcParams["image.cmap"] (default: 'viridis')

A Colormap instance or registered colormap name. cmap is only used if c is an array of floats.
normNormalize, default: None

If c is an array of floats, norm is used to scale the color data, c, in the range 0 to 1, in order to map into the colormap cmap. If None, use the default colors.Normalize.
vmin, vmaxfloat, default: None

vmin and vmax are used in conjunction with the default norm to map the color array c to the colormap cmap. If None, the respective min and max of the color array is used. It is an error to use vmin/vmax when norm is given.
alphafloat, default: None

The alpha blending value, between 0 (transparent) and 1 (opaque).
linewidthsfloat or array-like, default: rcParams["lines.linewidth"] (default: 1.5)

The linewidth of the marker edges. Note: The default edgecolors is 'face'. You may want to change this as well.
edgecolors{'face', 'none', None} or color or sequence of color, default: rcParams["scatter.edgecolors"] (default: 'face')

The edge color of the marker. Possible values:  'face': The edge color will always be the same as the face color. 'none': No patch boundary will be drawn. A color or sequence of colors.  For non-filled markers, edgecolors is ignored. Instead, the color is determined like with 'face', i.e. from c, colors, or facecolors.
plotnonfinitebool, default: False

Whether to plot points with nonfinite c (i.e. inf, -inf or nan). If True the points are drawn with the bad colormap color (see Colormap.set_bad).    Returns
 PathCollection
  Other Parameters

dataindexable object, optional

If given, the following parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception): x, y, s, linewidths, edgecolors, c, facecolor, facecolors, color
**kwargsCollection properties

    See also  plot

To plot scatter plots when markers are identical in size and color.    Notes  The plot function will be faster for scatterplots where markers don't vary in size or color. Any or all of x, y, s, and c may be masked arrays, in which case all masks will be combined and only unmasked points will be plotted. Fundamentally, scatter works with 1D arrays; x, y, s, and c may be input as N-D arrays, but within scatter they will be flattened. The exception is c, which will be flattened only if its size matches the size of x and y.
  Examples using matplotlib.pyplot.scatter

   Scatter Masked

   Scatter Symbol

   Scatter plot

   Hyperlinks

   Pyplot tutorial


matplotlib.pyplot.sci   matplotlib.pyplot.sci(im)[source]

Set the current image. This image will be the target of colormap functions like viridis, and other functions such as clim. The current image is an attribute of the current Axes.
  Examples using matplotlib.pyplot.sci

   Line Collection


matplotlib.pyplot.semilogx   matplotlib.pyplot.semilogx(*args, **kwargs)[source]

Make a plot with log scaling on the x axis. Call signatures: semilogx([x], y, [fmt], data=None, **kwargs)
semilogx([x], y, [fmt], [x2], y2, [fmt2], ..., **kwargs)
 This is just a thin wrapper around plot which additionally changes the x-axis to log scaling. All of the concepts and parameters of plot can be used here as well. The additional parameters base, subs, and nonpositive control the x-axis properties. They are just forwarded to Axes.set_xscale.  Parameters

basefloat, default: 10

Base of the x logarithm.
subsarray-like, optional

The location of the minor xticks. If None, reasonable locations are automatically chosen depending on the number of decades in the plot. See Axes.set_xscale for details.
nonpositive{'mask', 'clip'}, default: 'mask'

Non-positive values in x can be masked as invalid, or clipped to a very small positive number.  **kwargs

All parameters supported by plot.    Returns
 list of Line2D

Objects representing the plotted data.


matplotlib.pyplot.semilogy   matplotlib.pyplot.semilogy(*args, **kwargs)[source]

Make a plot with log scaling on the y axis. Call signatures: semilogy([x], y, [fmt], data=None, **kwargs)
semilogy([x], y, [fmt], [x2], y2, [fmt2], ..., **kwargs)
 This is just a thin wrapper around plot which additionally changes the y-axis to log scaling. All of the concepts and parameters of plot can be used here as well. The additional parameters base, subs, and nonpositive control the y-axis properties. They are just forwarded to Axes.set_yscale.  Parameters

basefloat, default: 10

Base of the y logarithm.
subsarray-like, optional

The location of the minor yticks. If None, reasonable locations are automatically chosen depending on the number of decades in the plot. See Axes.set_yscale for details.
nonpositive{'mask', 'clip'}, default: 'mask'

Non-positive values in y can be masked as invalid, or clipped to a very small positive number.  **kwargs

All parameters supported by plot.    Returns
 list of Line2D

Objects representing the plotted data.


matplotlib.pyplot.set_cmap   matplotlib.pyplot.set_cmap(cmap)[source]

Set the default colormap, and applies it to the current image if any.  Parameters

cmapColormap or str

A colormap instance or the name of a registered colormap.      See also  colormaps
matplotlib.cm.register_cmap
matplotlib.cm.get_cmap


matplotlib.pyplot.set_loglevel   matplotlib.pyplot.set_loglevel(*args, **kwargs)[source]

Set Matplotlib's root logger and root logger handler level, creating the handler if it does not exist yet. Typically, one should call set_loglevel("info") or set_loglevel("debug") to get additional debugging information.  Parameters

level{"notset", "debug", "info", "warning", "error", "critical"}

The log level of the handler.     Notes The first time this function is called, an additional handler is attached to Matplotlib's root handler; this handler is reused every time and this function simply manipulates the logger and handler's level.


matplotlib.pyplot.setp   matplotlib.pyplot.setp(obj, *args, **kwargs)[source]

Set one or more properties on an Artist, or list allowed values.  Parameters

objArtist or list of Artist

The artist(s) whose properties are being set or queried. When setting properties, all artists are affected; when querying the allowed values, only the first instance in the sequence is queried. For example, two lines can be made thicker and red with a single call: >>> x = arange(0, 1, 0.01)
>>> lines = plot(x, sin(2*pi*x), x, sin(4*pi*x))
>>> setp(lines, linewidth=2, color='r')

filefile-like, default: sys.stdout

Where setp writes its output when asked to list allowed values. >>> with open('output.log') as file:
...     setp(line, file=file)
 The default, None, means sys.stdout.  *args, **kwargs

The properties to set. The following combinations are supported:
Set the linestyle of a line to be dashed: >>> line, = plot([1, 2, 3])
>>> setp(line, linestyle='--')

Set multiple properties at once: >>> setp(line, linewidth=2, color='r')

List allowed values for a line's linestyle: >>> setp(line, 'linestyle')
linestyle: {'-', '--', '-.', ':', '', (offset, on-off-seq), ...}

List all properties that can be set, and their allowed values: >>> setp(line)
agg_filter: a filter function, ...
[long output listing omitted]
   setp also supports MATLAB style string/value pairs. For example, the following are equivalent: >>> setp(lines, 'linewidth', 2, 'color', 'r')  # MATLAB style
>>> setp(lines, linewidth=2, color='r')        # Python style
      See also  getp

  Examples using matplotlib.pyplot.setp

   Creating a timeline with lines, dates, and text

   Contouring the solution space of optimizations

   Creating annotated heatmaps

   Boxplots

   Pie Demo2

   Labeling a pie and a donut

   Patheffect Demo

   Set and get properties

   TickedStroke patheffect

   Topographic hillshading

   Evans test

   The Lifecycle of a Plot


matplotlib.pyplot.show   matplotlib.pyplot.show(*, block=None)[source]

Display all open figures.  Parameters

blockbool, optional

Whether to wait for all figures to be closed before returning. If True block and run the GUI main loop until all figure windows are closed. If False ensure that all figure windows are displayed and return immediately. In this case, you are responsible for ensuring that the event loop is running to have responsive figures. Defaults to True in non-interactive mode and to False in interactive mode (see pyplot.isinteractive).      See also  ion

Enable interactive mode, which shows / updates the figure after every plotting command, so that calling show() is not necessary.  ioff

Disable interactive mode.  savefig

Save the figure to an image file instead of showing it on screen.    Notes Saving figures to file and showing a window at the same time If you want an image file as well as a user interface window, use pyplot.savefig before pyplot.show. At the end of (a blocking) show() the figure is closed and thus unregistered from pyplot. Calling pyplot.savefig afterwards would save a new and thus empty figure. This limitation of command order does not apply if the show is non-blocking or if you keep a reference to the figure and use Figure.savefig. Auto-show in jupyter notebooks The jupyter backends (activated via %matplotlib inline, %matplotlib notebook, or %matplotlib widget), call show() at the end of every cell by default. Thus, you usually don't have to call it explicitly there.
  Examples using matplotlib.pyplot.show

   Bar Label Demo

   Stacked bar chart

   Grouped bar chart with labels

   Horizontal bar chart

   Broken Barh

   CapStyle

   Plotting categorical variables

   Plotting the coherence of two signals

   CSD Demo

   Curve with error band

   Errorbar limit selection

   Errorbar subsampling

   EventCollection Demo

   Eventplot Demo

   Filled polygon

   Fill Between and Alpha

   Fill Betweenx Demo

   Hatch-filled histograms

   Bar chart with gradients

   Hat graph

   Discrete distribution as horizontal bar chart

   JoinStyle

   Customizing dashed line styles

   Lines with a ticked patheffect

   Linestyles

   Marker reference

   Markevery Demo

   prop_cycle property markevery in rcParams

   Plotting masked and NaN values

   Multicolored lines

   Psd Demo

   Scatter Custom Symbol

   Scatter Demo2

   Scatter plot with histograms

   Scatter Masked

   Scatter plot with pie chart markers

   Marker examples

   Scatter Symbol

   Scatter plots with a legend

   Simple Plot

   Using span_where

   Spectrum Representations

   Stackplots and streamgraphs

   Stairs Demo

   Stem Plot

   Step Demo

   Creating a timeline with lines, dates, and text

   hlines and vlines

   Cross- and Auto-Correlation Demo

   Affine transform of an image

   Wind Barbs

   Barcode

   Contour Corner Mask

   Contour Demo

   Contour Image

   Contour Label Demo

   Contourf Demo

   Contourf Hatching

   Contourf and log color scale

   Contouring the solution space of optimizations

   BboxImage Demo

   Figimage Demo

   Creating annotated heatmaps

   Image antialiasing

   Clipping images with patches

   Image Demo

   Image Masked

   Image Nonuniform

   Blend transparency with color in 2D images

   Modifying the coordinate formatter

   Interpolations for imshow

   Contour plot of irregularly spaced data

   Layer Images

   Matshow

   Multi Image

   Pcolor Demo

   pcolormesh grids and shading

   pcolormesh

   Streamplot

   QuadMesh Demo

   Advanced quiver and quiverkey functions

   Quiver Simple Demo

   Shading example

   Spectrogram Demo

   Spy Demos

   Tricontour Demo

   Tricontour Smooth Delaunay

   Tricontour Smooth User

   Trigradient Demo

   Triinterp Demo

   Tripcolor Demo

   Triplot Demo

   Watermark image

   Aligning Labels

   Axes box aspect

   Axes Demo

   Controlling view limits using margins and sticky_edges

   Axes Props

   Axes Zoom Effect

   axhspan Demo

   Equal axis aspect ratio

   Axis Label Position

   Broken Axis

   Placing Colorbars

   Resizing axes with constrained layout

   Resizing axes with tight layout

   Different scales on the same axes

   Figure size in different units

   Figure labels: suptitle, supxlabel, supylabel

   Creating adjacent subplots

   Geographic Projections

   Combining two subplots using subplots and GridSpec

   Using Gridspec to make multi-column/row subplot layouts

   Nested Gridspecs

   Invert Axes

   Managing multiple figures in pyplot

   Secondary Axis

   Sharing axis limits and views

   Shared Axis

   Figure subfigures

   Multiple subplots

   Subplots spacings and margins

   Creating multiple subplots using plt.subplots

   Plots with different scales

   Zoom region inset axes

   Percentiles as horizontal bar chart

   Artist customization in box plots

   Box plots with custom fill colors

   Boxplots

   Box plot vs. violin plot comparison

   Boxplot drawer function

   Plot a confidence ellipse of a two-dimensional dataset

   Violin plot customization

   Errorbar function

   Different ways of specifying error bars

   Including upper and lower limits in error bars

   Creating boxes from error bars using PatchCollection

   Hexagonal binned plot

   Histograms

   Using histograms to plot a cumulative distribution

   Some features of the histogram (hist) function

   Demo of the histogram function's different histtype settings

   The histogram (hist) function with multiple data sets

   Producing multiple histograms side by side

   Time Series Histogram

   Violin plot basics

   Basic pie chart

   Pie Demo2

   Bar of pie

   Nested pie charts

   Labeling a pie and a donut

   Bar chart on polar axis

   Polar plot

   Polar Legend

   Scatter plot on polar axis

   Using accented text in matplotlib

   Scale invariant angle label

   Annotating Plots

   Arrow Demo

   Auto-wrapping text

   Composing Custom Legends

   Date tick labels

   Custom tick formatter for time series

   AnnotationBbox demo

   Using a text as a Path

   Text Rotation Mode

   The difference between \dfrac and \frac

   Labeling ticks using engineering notation

   Annotation arrow style reference

   Styling text boxes

   Figure legend demo

   Configuring the font family

   Using a ttf font file in Matplotlib

   Font table

   Fonts demo (object-oriented style)

   Fonts demo (keyword arguments)

   Labelling subplots

   Legend using pre-defined labels

   Legend Demo

   Artist within an artist

   Convert texts to images

   Mathtext

   Mathtext Examples

   Math fontfamily

   Multiline

   Placing text boxes

   Rainbow text

   STIX Fonts

   Rendering math equations using TeX

   Precise text layout

   Controlling style of text and labels using a dictionary

   Default text rotation demonstration

   Text Rotation Relative To Line

   Title positioning

   Unicode minus

   Usetex Baseline Test

   Usetex Fonteffects

   Text watermark

   Align y-labels

   Annotate Transform

   Annotating a plot

   Annotation Polar

   Programmatically controlling subplot adjustment

   Infinite lines

   Boxplot Demo

   Dollar Ticks

   Fig Axes Customize Simple

   Simple axes labels

   Adding lines to figures

   plot() format string

   Pyplot Mathtext

   Pyplot Simple

   Pyplot Text

   Pyplot Three

   Pyplot Two Subplots

   Text Commands

   Text Layout

   Color Demo

   Color by y-value

   Colors in the default property cycle

   Colorbar

   Colormap reference

   Creating a colormap from a list of colors

   List of named colors

   Arrow guide

   Reference for Matplotlib artists

   Line, Poly and RegularPoly Collection with autoscaling

   Compound path

   Dolphins

   Mmh Donuts!!!

   Ellipse Collection

   Ellipse Demo

   Drawing fancy boxes

   Hatch demo

   Line Collection

   Circles, Wedges and Polygons

   PathPatch object

   Bezier Curve

   Scatter plot

   Bayesian Methods for Hackers style sheet

   Dark background style sheet

   FiveThirtyEight style sheet

   ggplot style sheet

   Grayscale style sheet

   Solarized Light stylesheet

   Style sheets reference

   Anchored Direction Arrow

   Axes Divider

   Demo Axes Grid

   Axes Grid2

   HBoxDivider demo

   Showing RGB channels using RGBAxes

   Adding a colorbar to inset axes

   Colorbar with AxesDivider

   Controlling the position and size of colorbars with Inset Axes

   Per-row or per-column colorbars

   Axes with a fixed physical size

   Setting a fixed aspect on ImageGrid cells

   Inset Locator Demo

   Inset Locator Demo2

   Make Room For Ylabel Using Axesgrid

   Parasite Simple

   Parasite Simple2

   Scatter Histogram (Locatable Axes)

   Simple Anchored Artists

   Simple Axes Divider 1

   Simple Axes Divider 3

   Simple ImageGrid

   Simple ImageGrid 2

   Simple Axisline4

   Simple Colorbar

   Axis Direction

   axis_direction demo

   Axis line styles

   Curvilinear grid demo

   Demo CurveLinear Grid2

   mpl_toolkits.axisartist.floating_axes features

   floating_axis demo

   Parasite Axes demo

   Parasite axis demo

   Ticklabel alignment

   Ticklabel direction

   Simple Axis Direction01

   Simple Axis Direction03

   Simple Axis Pad

   Custom spines with axisartist

   Simple Axisline

   Simple Axisline3

   Anatomy of a figure

   Bachelor's degrees by gender

   Firefox

   Integral as the area under a curve

   Shaded & power normalized rendering

   XKCD

   Decay

   Animated histogram

   The Bayes update

   The double pendulum problem

   Animated image using a precomputed list of images

   Pausing and Resuming an Animation

   Rain simulation

   Animated 3D random walk

   Animated line plot

   Oscilloscope

   MATPLOTLIB UNCHAINED

   Close Event

   Mouse move and click events

   Data Browser

   Figure/Axes enter and leave events

   Interactive functions

   Image Slices Viewer

   Keypress event

   Lasso Demo

   Legend Picking

   Looking Glass

   Path Editor

   Pick Event Demo

   Pick Event Demo2

   Poly Editor

   Pong

   Resampling Data

   Timers

   Trifinder Event Demo

   Viewlims

   Zoom Window

   Frontpage contour example

   Anchored Artists

   Changing colors of lines intersecting a box

   Manual Contour

   Coords Report

   Cross hair cursor

   Custom projection

   Customize Rc

   AGG filter

   Ribbon Box

   Fill Spiral

   Findobj Demo

   Building histograms using Rectangles and PolyCollections

   Plotting with keywords

   Matplotlib logo

   Multiprocess

   Packed-bubble chart

   Patheffect Demo

   Pythonic Matplotlib

   Set and get properties

   Table Demo

   TickedStroke patheffect

   transforms.offset_copy

   Zorder Demo

   Plot 2D data on 3D plot

   Demo of 3D bar charts

   Create 2D bar graphs in different planes

   3D box surface plot

   Demonstrates plotting contour (level) curves in 3D

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

   Projecting contour profiles onto a graph

   Filled contours

   Projecting filled contour onto a graph

   Custom hillshading in a 3D surface plot

   3D errorbars

   Create 3D histogram of 2D data

   Parametric Curve

   Lorenz Attractor

   2D and 3D Axes in same Figure

   Automatic Text Offsetting

   Draw flat objects in 3D plot

   Generate polygons to fill under 3D line graph

   3D quiver plot

   3D scatterplot

   3D stem

   3D plots as subplots

   3D surface (colormap)

   3D surface (solid color)

   3D surface (checkerboard)

   3D surface with polar coordinates

   Text annotations in 3D

   Triangular 3D contour plot

   Triangular 3D filled contour plot

   Triangular 3D surfaces

   More triangular 3D surfaces

   3D voxel / volumetric plot

   3D voxel plot of the numpy logo

   3D voxel / volumetric plot with rgb colors

   3D voxel / volumetric plot with cylindrical coordinates

   3D wireframe plot

   3D wireframe plots in one direction

   Loglog Aspect

   Custom scale

   Log Bar

   Log Demo

   Log Axis

   Logit Demo

   Exploring normalizations

   Scales

   Symlog Demo

   Hillshading

   Anscombe's quartet

   Hinton diagrams

   Left ventricle bullseye

   MRI

   MRI With EEG

   Radar chart (aka spider or star chart)

   The Sankey class

   Long chain of connections using Sankey

   Rankine power cycle

   SkewT-logP diagram: using transforms and custom projections

   Topographic hillshading

   Centered spines with arrows

   Multiple Yaxis With Spines

   Spine Placement

   Spines

   Custom spine bounds

   Dropped spines

   Automatically setting tick positions

   Centering labels between ticks

   Colorbar Tick Labelling

   Custom Ticker1

   Formatting date ticks using ConciseDateFormatter

   Date Demo Convert

   Placing date ticks using recurrence rules

   Date Index Formatter

   Date Precision and Epochs

   Major and minor ticks

   The default tick formatter

   Tick formatters

   Tick locators

   Set default y-axis tick labels on the right

   Setting tick labels from a list of values

   Set default x-axis tick labels on the top

   Rotating custom tick labels

   Annotation with units

   Artist tests

   Bar demo with units

   Group barchart with units

   Ellipse With Units

   Evans test

   Radian ticks

   Inches and Centimeters

   Unit handling

   pyplot with GTK3

   pyplot with GTK4

   Tool Manager

   Anchored Box04

   Annotate Explain

   Annotate Simple01

   Annotate Simple02

   Annotate Simple03

   Annotate Simple04

   Annotate Simple Coord01

   Annotate Simple Coord02

   Annotate Simple Coord03

   Annotate Text Arrow

   Interactive Adjustment of Colormap Range

   Colormap Normalizations

   Colormap Normalizations Symlognorm

   Connect Simple01

   Connection styles for annotations

   Custom box styles

   subplot2grid demo

   GridSpec demo

   Nested GridSpecs

   Simple Annotate01

   Simple Legend01

   Simple Legend02

   Annotated Cursor

   Buttons

   Check Buttons

   Cursor

   Lasso Selector

   Menu

   Mouse Cursor

   Multicursor

   Polygon Selector

   Radio Buttons

   Thresholding an Image with RangeSlider

   Rectangle and ellipse selectors

   Slider

   Snapping Sliders to Discrete Values

   Span Selector

   Textbox

   Pyplot tutorial

   The Lifecycle of a Plot

   Customizing Matplotlib with style sheets and rcParams

   Artist tutorial

   Legend guide

   Styling with cycler

   Constrained Layout Guide

   Tight Layout guide

   Arranging multiple Axes in a Figure

   origin and extent in imshow

   Faster rendering by using blitting

   Path Tutorial

   Path effects guide

   Transformations Tutorial

   Specifying Colors

   Customized Colorbars Tutorial

   Creating Colormaps in Matplotlib

   Colormap Normalization

   Choosing Colormaps in Matplotlib

   Text in Matplotlib Plots

   Text properties and layout

   plot(x, y)

   scatter(x, y)

   bar(x, height) / barh(y, width)

   stem(x, y)

   step(x, y)

   fill_between(x, y1, y2)

   imshow(Z)

   pcolormesh(X, Y, Z)

   contour(X, Y, Z)

   contourf(X, Y, Z)

   barbs(X, Y, U, V)

   quiver(X, Y, U, V)

   streamplot(X, Y, U, V)

   hist(x)

   boxplot(X)

   errorbar(x, y, yerr, xerr)

   violinplot(D)

   eventplot(D)

   hist2d(x, y)

   hexbin(x, y, C)

   pie(x)

   tricontour(x, y, z)

   tricontourf(x, y, z)

   tripcolor(x, y, z)

   triplot(x, y)


matplotlib.pyplot.specgram   matplotlib.pyplot.specgram(x, NFFT=None, Fs=None, Fc=None, detrend=None, window=None, noverlap=None, cmap=None, xextent=None, pad_to=None, sides=None, scale_by_freq=None, mode=None, scale=None, vmin=None, vmax=None, *, data=None, **kwargs)[source]

Plot a spectrogram. Compute and plot a spectrogram of data in x. Data are split into NFFT length segments and the spectrum of each section is computed. The windowing function window is applied to each segment, and the amount of overlap of each segment is specified with noverlap. The spectrogram is plotted as a colormap (using imshow).  Parameters

x1-D array or sequence

Array or sequence containing the data.
Fsfloat, default: 2

The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit.
windowcallable or ndarray, default: window_hanning

A function or a vector of length NFFT. To create window vectors see window_hanning, window_none, numpy.blackman, numpy.hamming, numpy.bartlett, scipy.signal, scipy.signal.get_window, etc. If a function is passed as the argument, it must take a data segment as an argument and return the windowed version of the segment.
sides{'default', 'onesided', 'twosided'}, optional

Which sides of the spectrum to return. 'default' is one-sided for real data and two-sided for complex data. 'onesided' forces the return of a one-sided spectrum, while 'twosided' forces two-sided.
pad_toint, optional

The number of points to which the data segment is padded when performing the FFT. This can be different from NFFT, which specifies the number of data points used. While not increasing the actual resolution of the spectrum (the minimum distance between resolvable peaks), this can give more points in the plot, allowing for more detail. This corresponds to the n parameter in the call to fft(). The default is None, which sets pad_to equal to NFFT
NFFTint, default: 256

The number of data points used in each block for the FFT. A power 2 is most efficient. This should NOT be used to get zero padding, or the scaling of the result will be incorrect; use pad_to for this instead.
detrend{'none', 'mean', 'linear'} or callable, default: 'none'

The function applied to each segment before fft-ing, designed to remove the mean or linear trend. Unlike in MATLAB, where the detrend parameter is a vector, in Matplotlib it is a function. The mlab module defines detrend_none, detrend_mean, and detrend_linear, but you can use a custom function as well. You can also use a string to choose one of the functions: 'none' calls detrend_none. 'mean' calls detrend_mean. 'linear' calls detrend_linear.
scale_by_freqbool, default: True

Whether the resulting density values should be scaled by the scaling frequency, which gives density in units of Hz^-1. This allows for integration over the returned frequency values. The default is True for MATLAB compatibility.
mode{'default', 'psd', 'magnitude', 'angle', 'phase'}

What sort of spectrum to use. Default is 'psd', which takes the power spectral density. 'magnitude' returns the magnitude spectrum. 'angle' returns the phase spectrum without unwrapping. 'phase' returns the phase spectrum with unwrapping.
noverlapint, default: 128

The number of points of overlap between blocks.
scale{'default', 'linear', 'dB'}

The scaling of the values in the spec. 'linear' is no scaling. 'dB' returns the values in dB scale. When mode is 'psd', this is dB power (10 * log10). Otherwise this is dB amplitude (20 * log10). 'default' is 'dB' if mode is 'psd' or 'magnitude' and 'linear' otherwise. This must be 'linear' if mode is 'angle' or 'phase'.
Fcint, default: 0

The center frequency of x, which offsets the x extents of the plot to reflect the frequency range used when a signal is acquired and then filtered and downsampled to baseband.
cmapColormap, default: rcParams["image.cmap"] (default: 'viridis')

xextentNone or (xmin, xmax)

The image extent along the x-axis. The default sets xmin to the left border of the first bin (spectrum column) and xmax to the right border of the last bin. Note that for noverlap>0 the width of the bins is smaller than those of the segments.
dataindexable object, optional

If given, the following parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception): x  **kwargs

Additional keyword arguments are passed on to imshow which makes the specgram image. The origin keyword argument is not supported.    Returns

spectrum2D array

Columns are the periodograms of successive segments.
freqs1-D array

The frequencies corresponding to the rows in spectrum.
t1-D array

The times corresponding to midpoints of segments (i.e., the columns in spectrum).
imAxesImage

The image created by imshow containing the spectrogram.      See also  psd

Differs in the default overlap; in returning the mean of the segment periodograms; in not returning times; and in generating a line plot instead of colormap.  magnitude_spectrum

A single spectrum, similar to having a single segment when mode is 'magnitude'. Plots a line instead of a colormap.  angle_spectrum

A single spectrum, similar to having a single segment when mode is 'angle'. Plots a line instead of a colormap.  phase_spectrum

A single spectrum, similar to having a single segment when mode is 'phase'. Plots a line instead of a colormap.    Notes The parameters detrend and scale_by_freq do only apply when mode is set to 'psd'.


matplotlib.pyplot.spring   matplotlib.pyplot.spring()[source]

Set the colormap to 'spring'. This changes the default colormap as well as the colormap of the current image if there is one. See help(colormaps) for more information.


matplotlib.pyplot.spy   matplotlib.pyplot.spy(Z, precision=0, marker=None, markersize=None, aspect='equal', origin='upper', **kwargs)[source]

Plot the sparsity pattern of a 2D array. This visualizes the non-zero values of the array. Two plotting styles are available: image and marker. Both are available for full arrays, but only the marker style works for scipy.sparse.spmatrix instances. Image style If marker and markersize are None, imshow is used. Any extra remaining keyword arguments are passed to this method. Marker style If Z is a scipy.sparse.spmatrix or marker or markersize are None, a Line2D object will be returned with the value of marker determining the marker type, and any remaining keyword arguments passed to plot.  Parameters

Z(M, N) array-like

The array to be plotted.
precisionfloat or 'present', default: 0

If precision is 0, any non-zero value will be plotted. Otherwise, values of \(|Z| > precision\) will be plotted. For scipy.sparse.spmatrix instances, you can also pass 'present'. In this case any value present in the array will be plotted, even if it is identically zero.
aspect{'equal', 'auto', None} or float, default: 'equal'

The aspect ratio of the Axes. This parameter is particularly relevant for images since it determines whether data pixels are square. This parameter is a shortcut for explicitly calling Axes.set_aspect. See there for further details.  'equal': Ensures an aspect ratio of 1. Pixels will be square. 'auto': The Axes is kept fixed and the aspect is adjusted so that the data fit in the Axes. In general, this will result in non-square pixels.
None: Use rcParams["image.aspect"] (default: 'equal').
origin{'upper', 'lower'}, default: rcParams["image.origin"] (default: 'upper')

Place the [0, 0] index of the array in the upper left or lower left corner of the Axes. The convention 'upper' is typically used for matrices and images.    Returns

AxesImage or Line2D

The return type depends on the plotting style (see above).    Other Parameters
 **kwargs

The supported additional parameters depend on the plotting style. For the image style, you can pass the following additional parameters of imshow:  cmap alpha url any Artist properties (passed on to the AxesImage)  For the marker style, you can pass any Line2D property except for linestyle:
Property Description
agg_filter a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array
alpha scalar or None
animated bool
antialiased or aa bool
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
color or c color
dash_capstyle CapStyle or {'butt', 'projecting', 'round'}
dash_joinstyle JoinStyle or {'miter', 'round', 'bevel'}
dashes sequence of floats (on/off ink in points) or (None, None)
data (2, N) array or two 1D arrays
drawstyle or ds {'default', 'steps', 'steps-pre', 'steps-mid', 'steps-post'}, default: 'default'
figure Figure
fillstyle {'full', 'left', 'right', 'bottom', 'top', 'none'}
gid str
in_layout bool
label object
linestyle or ls {'-', '--', '-.', ':', '', (offset, on-off-seq), ...}
linewidth or lw float
marker marker style string, Path or MarkerStyle
markeredgecolor or mec color
markeredgewidth or mew float
markerfacecolor or mfc color
markerfacecoloralt or mfcalt color
markersize or ms float
markevery None or int or (int, int) or slice or list[int] or float or (float, float) or list[bool]
path_effects AbstractPathEffect
picker float or callable[[Artist, Event], tuple[bool, dict]]
pickradius float
rasterized bool
sketch_params (scale: float, length: float, randomness: float)
snap bool or None
solid_capstyle CapStyle or {'butt', 'projecting', 'round'}
solid_joinstyle JoinStyle or {'miter', 'round', 'bevel'}
transform unknown
url str
visible bool
xdata 1D array
ydata 1D array
zorder float


matplotlib.pyplot.stackplot   matplotlib.pyplot.stackplot(x, *args, labels=(), colors=None, baseline='zero', data=None, **kwargs)[source]

Draw a stacked area plot.  Parameters

x(N,) array-like

y(M, N) array-like

The data is assumed to be unstacked. Each of the following calls is legal: stackplot(x, y)           # where y has shape (M, N)
stackplot(x, y1, y2, y3)  # where y1, y2, y3, y4 have length N

baseline{'zero', 'sym', 'wiggle', 'weighted_wiggle'}

Method used to calculate the baseline:
'zero': Constant zero baseline, i.e. a simple stacked plot.
'sym': Symmetric around zero and is sometimes called 'ThemeRiver'.
'wiggle': Minimizes the sum of the squared slopes.
'weighted_wiggle': Does the same but weights to account for size of each layer. It is also called 'Streamgraph'-layout. More details can be found at http://leebyron.com/streamgraph/.
labelslist of str, optional

A sequence of labels to assign to each data series. If unspecified, then no labels will be applied to artists.
colorslist of color, optional

A sequence of colors to be cycled through and used to color the stacked areas. The sequence need not be exactly the same length as the number of provided y, in which case the colors will repeat from the beginning. If not specified, the colors from the Axes property cycle will be used.
dataindexable object, optional

If given, all parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception).  **kwargs

All other keyword arguments are passed to Axes.fill_between.    Returns
 list of PolyCollection

A list of PolyCollection instances, one for each element in the stacked area plot.


matplotlib.pyplot.stairs   matplotlib.pyplot.stairs(values, edges=None, *, orientation='vertical', baseline=0, fill=False, data=None, **kwargs)[source]

A stepwise constant function as a line with bounding edges or a filled plot.  Parameters

valuesarray-like

The step heights.
edgesarray-like

The edge positions, with len(edges) == len(vals) + 1, between which the curve takes on vals values.
orientation{'vertical', 'horizontal'}, default: 'vertical'

The direction of the steps. Vertical means that values are along the y-axis, and edges are along the x-axis.
baselinefloat, array-like or None, default: 0

The bottom value of the bounding edges or when fill=True, position of lower edge. If fill is True or an array is passed to baseline, a closed path is drawn.
fillbool, default: False

Whether the area under the step curve should be filled.    Returns

StepPatchmatplotlib.patches.StepPatch

  Other Parameters

dataindexable object, optional

If given, all parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception).  **kwargs

StepPatch properties
  Examples using matplotlib.pyplot.stairs

   Stairs Demo


matplotlib.pyplot.stem   matplotlib.pyplot.stem(*args, linefmt=None, markerfmt=None, basefmt=None, bottom=0, label=None, use_line_collection=True, orientation='vertical', data=None)[source]

Create a stem plot. A stem plot draws lines perpendicular to a baseline at each location locs from the baseline to heads, and places a marker there. For vertical stem plots (the default), the locs are x positions, and the heads are y values. For horizontal stem plots, the locs are y positions, and the heads are x values. Call signature: stem([locs,] heads, linefmt=None, markerfmt=None, basefmt=None)
 The locs-positions are optional. The formats may be provided either as positional or as keyword-arguments.  Parameters

locsarray-like, default: (0, 1, ..., len(heads) - 1)

For vertical stem plots, the x-positions of the stems. For horizontal stem plots, the y-positions of the stems.
headsarray-like

For vertical stem plots, the y-values of the stem heads. For horizontal stem plots, the x-values of the stem heads.
linefmtstr, optional

A string defining the color and/or linestyle of the vertical lines:
Character Line Style
'-' solid line
'--' dashed line
'-.' dash-dot line
':' dotted line   Default: 'C0-', i.e. solid line with the first color of the color cycle. Note: Markers specified through this parameter (e.g. 'x') will be silently ignored (unless using use_line_collection=False). Instead, markers should be specified using markerfmt.
markerfmtstr, optional

A string defining the color and/or shape of the markers at the stem heads. Default: 'C0o', i.e. filled circles with the first color of the color cycle.
basefmtstr, default: 'C3-' ('C2-' in classic mode)

A format string defining the properties of the baseline.
orientationstr, default: 'vertical'

If 'vertical', will produce a plot with stems oriented vertically, otherwise the stems will be oriented horizontally.
bottomfloat, default: 0

The y/x-position of the baseline (depending on orientation).
labelstr, default: None

The label to use for the stems in legends.
use_line_collectionbool, default: True

If True, store and plot the stem lines as a LineCollection instead of individual lines, which significantly increases performance. If False, defaults to the old behavior of using a list of Line2D objects. This parameter may be deprecated in the future.
dataindexable object, optional

If given, all parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception).    Returns
 StemContainer

The container may be treated like a tuple (markerline, stemlines, baseline)     Notes  See also The MATLAB function stem which inspired this method.
  Examples using matplotlib.pyplot.stem

   Stem Plot


matplotlib.pyplot.step   matplotlib.pyplot.step(x, y, *args, where='pre', data=None, **kwargs)[source]

Make a step plot. Call signatures: step(x, y, [fmt], *, data=None, where='pre', **kwargs)
step(x, y, [fmt], x2, y2, [fmt2], ..., *, where='pre', **kwargs)
 This is just a thin wrapper around plot which changes some formatting options. Most of the concepts and parameters of plot can be used here as well.  Note This method uses a standard plot with a step drawstyle: The x values are the reference positions and steps extend left/right/both directions depending on where. For the common case where you know the values and edges of the steps, use stairs instead.   Parameters

xarray-like

1D sequence of x positions. It is assumed, but not checked, that it is uniformly increasing.
yarray-like

1D sequence of y levels.
fmtstr, optional

A format string, e.g. 'g' for a green line. See plot for a more detailed description. Note: While full format strings are accepted, it is recommended to only specify the color. Line styles are currently ignored (use the keyword argument linestyle instead). Markers are accepted and plotted on the given positions, however, this is a rarely needed feature for step plots.
where{'pre', 'post', 'mid'}, default: 'pre'

Define where the steps should be placed:  'pre': The y value is continued constantly to the left from every x position, i.e. the interval (x[i-1], x[i]] has the value y[i]. 'post': The y value is continued constantly to the right from every x position, i.e. the interval [x[i], x[i+1]) has the value y[i]. 'mid': Steps occur half-way between the x positions.
dataindexable object, optional

An object with labelled data. If given, provide the label names to plot in x and y.  **kwargs

Additional parameters are the same as those for plot.    Returns
 list of Line2D

Objects representing the plotted data.
  Examples using matplotlib.pyplot.step

   Stairs Demo

   Step Demo


matplotlib.pyplot.streamplot   matplotlib.pyplot.streamplot(x, y, u, v, density=1, linewidth=None, color=None, cmap=None, norm=None, arrowsize=1, arrowstyle='-|>', minlength=0.1, transform=None, zorder=None, start_points=None, maxlength=4.0, integration_direction='both', *, data=None)[source]

Draw streamlines of a vector flow.  Parameters

x, y1D/2D arrays

Evenly spaced strictly increasing arrays to make a grid. If 2D, all rows of x must be equal and all columns of y must be equal; i.e., they must be as if generated by np.meshgrid(x_1d, y_1d).
u, v2D arrays

x and y-velocities. The number of rows and columns must match the length of y and x, respectively.
densityfloat or (float, float)

Controls the closeness of streamlines. When density = 1, the domain is divided into a 30x30 grid. density linearly scales this grid. Each cell in the grid can have, at most, one traversing streamline. For different densities in each direction, use a tuple (density_x, density_y).
linewidthfloat or 2D array

The width of the stream lines. With a 2D array the line width can be varied across the grid. The array must have the same shape as u and v.
colorcolor or 2D array

The streamline color. If given an array, its values are converted to colors using cmap and norm. The array must have the same shape as u and v.
cmapColormap

Colormap used to plot streamlines and arrows. This is only used if color is an array.
normNormalize

Normalize object used to scale luminance data to 0, 1. If None, stretch (min, max) to (0, 1). This is only used if color is an array.
arrowsizefloat

Scaling factor for the arrow size.
arrowstylestr

Arrow style specification. See FancyArrowPatch.
minlengthfloat

Minimum length of streamline in axes coordinates.
start_pointsNx2 array

Coordinates of starting points for the streamlines in data coordinates (the same coordinates as the x and y arrays).
zorderint

The zorder of the stream lines and arrows. Artists with lower zorder values are drawn first.
maxlengthfloat

Maximum length of streamline in axes coordinates.
integration_direction{'forward', 'backward', 'both'}, default: 'both'

Integrate the streamline in forward, backward or both directions.
dataindexable object, optional

If given, the following parameters also accept a string s, which is interpreted as data[s] (unless this raises an exception): x, y, u, v, start_points    Returns
 StreamplotSet

Container object with attributes
lines: LineCollection of streamlines
arrows: PatchCollection containing FancyArrowPatch objects representing the arrows half-way along stream lines.  This container will probably change in the future to allow changes to the colormap, alpha, etc. for both lines and arrows, but these changes should be backward compatible.


matplotlib.pyplot.subplot   matplotlib.pyplot.subplot(*args, **kwargs)[source]

Add an Axes to the current figure or retrieve an existing Axes. This is a wrapper of Figure.add_subplot which provides additional behavior when working with the implicit API (see the notes section). Call signatures: subplot(nrows, ncols, index, **kwargs)
subplot(pos, **kwargs)
subplot(**kwargs)
subplot(ax)
  Parameters

*argsint, (int, int, index), or SubplotSpec, default: (1, 1, 1)

The position of the subplot described by one of  Three integers (nrows, ncols, index). The subplot will take the index position on a grid with nrows rows and ncols columns. index starts at 1 in the upper left corner and increases to the right. index can also be a two-tuple specifying the (first, last) indices (1-based, and including last) of the subplot, e.g., fig.add_subplot(3, 1, (1, 2)) makes a subplot that spans the upper 2/3 of the figure. A 3-digit integer. The digits are interpreted as if given separately as three single-digit integers, i.e. fig.add_subplot(235) is the same as fig.add_subplot(2, 3, 5). Note that this can only be used if there are no more than 9 subplots. A SubplotSpec.
projection{None, 'aitoff', 'hammer', 'lambert', 'mollweide', 'polar', 'rectilinear', str}, optional

The projection type of the subplot (Axes). str is the name of a custom projection, see projections. The default None results in a 'rectilinear' projection.
polarbool, default: False

If True, equivalent to projection='polar'.
sharex, shareyAxes, optional

Share the x or y axis with sharex and/or sharey. The axis will have the same limits, ticks, and scale as the axis of the shared axes.
labelstr

A label for the returned axes.    Returns

axes.SubplotBase, or another subclass of Axes

The axes of the subplot. The returned axes base class depends on the projection used. It is Axes if rectilinear projection is used and projections.polar.PolarAxes if polar projection is used. The returned axes is then a subplot subclass of the base class.    Other Parameters
 **kwargs

This method also takes the keyword arguments for the returned axes base class; except for the figure argument. The keyword arguments for the rectilinear base class Axes can be found in the following table but there might also be other keyword arguments if another projection is used.
Property Description
adjustable {'box', 'datalim'}
agg_filter a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array
alpha scalar or None
anchor (float, float) or {'C', 'SW', 'S', 'SE', 'E', 'NE', ...}
animated bool
aspect {'auto', 'equal'} or float
autoscale_on bool
autoscalex_on bool
autoscaley_on bool
axes_locator Callable[[Axes, Renderer], Bbox]
axisbelow bool or 'line'
box_aspect float or None
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
facecolor or fc color
figure Figure
frame_on bool
gid str
in_layout bool
label object
navigate bool
navigate_mode unknown
path_effects AbstractPathEffect
picker None or bool or float or callable
position [left, bottom, width, height] or Bbox
prop_cycle unknown
rasterization_zorder float or None
rasterized bool
sketch_params (scale: float, length: float, randomness: float)
snap bool or None
title str
transform Transform
url str
visible bool
xbound unknown
xlabel str
xlim (bottom: float, top: float)
xmargin float greater than -0.5
xscale {"linear", "log", "symlog", "logit", ...} or ScaleBase
xticklabels unknown
xticks unknown
ybound unknown
ylabel str
ylim (bottom: float, top: float)
ymargin float greater than -0.5
yscale {"linear", "log", "symlog", "logit", ...} or ScaleBase
yticklabels unknown
yticks unknown
zorder float        See also  Figure.add_subplot
pyplot.subplots
pyplot.axes
Figure.subplots
  Notes Creating a new Axes will delete any pre-existing Axes that overlaps with it beyond sharing a boundary: import matplotlib.pyplot as plt
# plot a line, implicitly creating a subplot(111)
plt.plot([1, 2, 3])
# now create a subplot which represents the top plot of a grid
# with 2 rows and 1 column. Since this subplot will overlap the
# first, the plot (and its axes) previously created, will be removed
plt.subplot(211)
 If you do not want this behavior, use the Figure.add_subplot method or the pyplot.axes function instead. If no kwargs are passed and there exists an Axes in the location specified by args then that Axes will be returned rather than a new Axes being created. If kwargs are passed and there exists an Axes in the location specified by args, the projection type is the same, and the kwargs match with the existing Axes, then the existing Axes is returned. Otherwise a new Axes is created with the specified parameters. We save a reference to the kwargs which we use for this comparison. If any of the values in kwargs are mutable we will not detect the case where they are mutated. In these cases we suggest using Figure.add_subplot and the explicit Axes API rather than the implicit pyplot API. Examples plt.subplot(221)

# equivalent but more general
ax1 = plt.subplot(2, 2, 1)

# add a subplot with no frame
ax2 = plt.subplot(222, frameon=False)

# add a polar subplot
plt.subplot(223, projection='polar')

# add a red subplot that shares the x-axis with ax1
plt.subplot(224, sharex=ax1, facecolor='red')

# delete ax2 from the figure
plt.delaxes(ax2)

# add ax2 to the figure again
plt.subplot(ax2)

# make the first axes "current" again
plt.subplot(221)

  Examples using matplotlib.pyplot.subplot

   Controlling view limits using margins and sticky_edges

   Resizing axes with tight layout

   Geographic Projections

   Managing multiple figures in pyplot

   Sharing axis limits and views

   Shared Axis

   Multiple subplots

   Subplots spacings and margins

   Bar chart on polar axis

   Pyplot Two Subplots

   Simple Colorbar

   MATPLOTLIB UNCHAINED

   Customize Rc

   transforms.offset_copy

   Pyplot tutorial

   Constrained Layout Guide

   Tight Layout guide


matplotlib.pyplot.subplot2grid   matplotlib.pyplot.subplot2grid(shape, loc, rowspan=1, colspan=1, fig=None, **kwargs)[source]

Create a subplot at a specific location inside a regular grid.  Parameters

shape(int, int)

Number of rows and of columns of the grid in which to place axis.
loc(int, int)

Row number and column number of the axis location within the grid.
rowspanint, default: 1

Number of rows for the axis to span downwards.
colspanint, default: 1

Number of columns for the axis to span to the right.
figFigure, optional

Figure to place the subplot in. Defaults to the current figure.  **kwargs

Additional keyword arguments are handed to add_subplot.    Returns

axes.SubplotBase, or another subclass of Axes

The axes of the subplot. The returned axes base class depends on the projection used. It is Axes if rectilinear projection is used and projections.polar.PolarAxes if polar projection is used. The returned axes is then a subplot subclass of the base class.     Notes The following call ax = subplot2grid((nrows, ncols), (row, col), rowspan, colspan)
 is identical to fig = gcf()
gs = fig.add_gridspec(nrows, ncols)
ax = fig.add_subplot(gs[row:row+rowspan, col:col+colspan])

  Examples using matplotlib.pyplot.subplot2grid

   Resizing axes with tight layout

   subplot2grid demo

   Constrained Layout Guide

   Tight Layout guide


matplotlib.pyplot.subplot_mosaic   matplotlib.pyplot.subplot_mosaic(mosaic, *, sharex=False, sharey=False, subplot_kw=None, gridspec_kw=None, empty_sentinel='.', **fig_kw)[source]

Build a layout of Axes based on ASCII art or nested lists. This is a helper function to build complex GridSpec layouts visually.  Note This API is provisional and may be revised in the future based on early user feedback.   Parameters

mosaiclist of list of {hashable or nested} or str

A visual layout of how you want your Axes to be arranged labeled as strings. For example x = [['A panel', 'A panel', 'edge'],
     ['C panel', '.',       'edge']]
 produces 4 axes:  'A panel' which is 1 row high and spans the first two columns 'edge' which is 2 rows high and is on the right edge 'C panel' which in 1 row and 1 column wide in the bottom left a blank space 1 row and 1 column wide in the bottom center  Any of the entries in the layout can be a list of lists of the same form to create nested layouts. If input is a str, then it must be of the form '''
AAE
C.E
'''
 where each character is a column and each line is a row. This only allows only single character Axes labels and does not allow nesting but is very terse.
sharex, shareybool, default: False

If True, the x-axis (sharex) or y-axis (sharey) will be shared among all subplots. In that case, tick label visibility and axis units behave as for subplots. If False, each subplot's x- or y-axis will be independent.
subplot_kwdict, optional

Dictionary with keywords passed to the Figure.add_subplot call used to create each subplot.
gridspec_kwdict, optional

Dictionary with keywords passed to the GridSpec constructor used to create the grid the subplots are placed on.
empty_sentinelobject, optional

Entry in the layout to mean "leave this space empty". Defaults to '.'. Note, if layout is a string, it is processed via inspect.cleandoc to remove leading white space, which may interfere with using white-space as the empty sentinel.  **fig_kw

All additional keyword arguments are passed to the pyplot.figure call.    Returns

figFigure

The new figure  dict[label, Axes]

A dictionary mapping the labels to the Axes objects. The order of the axes is left-to-right and top-to-bottom of their position in the total layout.
  Examples using matplotlib.pyplot.subplot_mosaic

   Image Demo

   Labelling subplots

   Basic Usage

   Legend guide

   Arranging multiple Axes in a Figure


matplotlib.pyplot.subplot_tool   matplotlib.pyplot.subplot_tool(targetfig=None)[source]

Launch a subplot tool window for a figure.  Returns
 matplotlib.widgets.SubplotTool


matplotlib.pyplot.subplots   matplotlib.pyplot.subplots(nrows=1, ncols=1, *, sharex=False, sharey=False, squeeze=True, subplot_kw=None, gridspec_kw=None, **fig_kw)[source]

Create a figure and a set of subplots. This utility wrapper makes it convenient to create common layouts of subplots, including the enclosing figure object, in a single call.  Parameters

nrows, ncolsint, default: 1

Number of rows/columns of the subplot grid.
sharex, shareybool or {'none', 'all', 'row', 'col'}, default: False

Controls sharing of properties among x (sharex) or y (sharey) axes:  True or 'all': x- or y-axis will be shared among all subplots. False or 'none': each subplot x- or y-axis will be independent. 'row': each subplot row will share an x- or y-axis. 'col': each subplot column will share an x- or y-axis.  When subplots have a shared x-axis along a column, only the x tick labels of the bottom subplot are created. Similarly, when subplots have a shared y-axis along a row, only the y tick labels of the first column subplot are created. To later turn other subplots' ticklabels on, use tick_params. When subplots have a shared axis that has units, calling set_units will update each axis with the new units.
squeezebool, default: True

If True, extra dimensions are squeezed out from the returned array of Axes:  if only one subplot is constructed (nrows=ncols=1), the resulting single Axes object is returned as a scalar. for Nx1 or 1xM subplots, the returned object is a 1D numpy object array of Axes objects. for NxM, subplots with N>1 and M>1 are returned as a 2D array.   If False, no squeezing at all is done: the returned Axes object is always a 2D array containing Axes instances, even if it ends up being 1x1.
subplot_kwdict, optional

Dict with keywords passed to the add_subplot call used to create each subplot.
gridspec_kwdict, optional

Dict with keywords passed to the GridSpec constructor used to create the grid the subplots are placed on.  **fig_kw

All additional keyword arguments are passed to the pyplot.figure call.    Returns

figFigure

axaxes.Axes or array of Axes

ax can be either a single Axes object or an array of Axes objects if more than one subplot was created. The dimensions of the resulting array can be controlled with the squeeze keyword, see above. Typical idioms for handling the return value are: # using the variable ax for single a Axes
fig, ax = plt.subplots()

# using the variable axs for multiple Axes
fig, axs = plt.subplots(2, 2)

# using tuple unpacking for multiple Axes
fig, (ax1, ax2) = plt.subplots(1, 2)
fig, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2)
 The names ax and pluralized axs are preferred over axes because for the latter it's not clear if it refers to a single Axes instance or a collection of these.      See also  pyplot.figure
pyplot.subplot
pyplot.axes
Figure.subplots
Figure.add_subplot
  Examples # First create some toy data:
x = np.linspace(0, 2*np.pi, 400)
y = np.sin(x**2)

# Create just a figure and only one subplot
fig, ax = plt.subplots()
ax.plot(x, y)
ax.set_title('Simple plot')

# Create two subplots and unpack the output array immediately
f, (ax1, ax2) = plt.subplots(1, 2, sharey=True)
ax1.plot(x, y)
ax1.set_title('Sharing Y axis')
ax2.scatter(x, y)

# Create four polar axes and access them through the returned array
fig, axs = plt.subplots(2, 2, subplot_kw=dict(projection="polar"))
axs[0, 0].plot(x, y)
axs[1, 1].scatter(x, y)

# Share a X axis with each column of subplots
plt.subplots(2, 2, sharex='col')

# Share a Y axis with each row of subplots
plt.subplots(2, 2, sharey='row')

# Share both X and Y axes with all subplots
plt.subplots(2, 2, sharex='all', sharey='all')

# Note that this is the same as
plt.subplots(2, 2, sharex=True, sharey=True)

# Create figure number 10 with a single subplot
# and clears it if it already exists.
fig, ax = plt.subplots(num=10, clear=True)

  Examples using matplotlib.pyplot.subplots

   Bar Label Demo

   Stacked bar chart

   Grouped bar chart with labels

   Horizontal bar chart

   Broken Barh

   Plotting categorical variables

   Plotting the coherence of two signals

   CSD Demo

   Curve with error band

   Errorbar subsampling

   Eventplot Demo

   Filled polygon

   Fill Between and Alpha

   Filling the area between lines

   Fill Betweenx Demo

   Hatch-filled histograms

   Bar chart with gradients

   Hat graph

   Discrete distribution as horizontal bar chart

   Customizing dashed line styles

   Lines with a ticked patheffect

   Marker reference

   Multicolored lines

   Psd Demo

   Scatter Custom Symbol

   Scatter Demo2

   Scatter plot with pie chart markers

   Marker examples

   Scatter plots with a legend

   Simple Plot

   Using span_where

   Spectrum Representations

   Stackplots and streamgraphs

   Stairs Demo

   Creating a timeline with lines, dates, and text

   hlines and vlines

   Cross- and Auto-Correlation Demo

   Affine transform of an image

   Wind Barbs

   Contour Corner Mask

   Contour Demo

   Contour Image

   Contour Label Demo

   Contourf Demo

   Contourf Hatching

   Contourf and log color scale

   Contouring the solution space of optimizations

   BboxImage Demo

   Creating annotated heatmaps

   Image antialiasing

   Clipping images with patches

   Image Demo

   Image Masked

   Image Nonuniform

   Blend transparency with color in 2D images

   Modifying the coordinate formatter

   Interpolations for imshow

   Contour plot of irregularly spaced data

   Multi Image

   Pcolor Demo

   pcolormesh grids and shading

   pcolormesh

   QuadMesh Demo

   Advanced quiver and quiverkey functions

   Quiver Simple Demo

   Shading example

   Spectrogram Demo

   Spy Demos

   Tricontour Demo

   Tricontour Smooth Delaunay

   Tricontour Smooth User

   Trigradient Demo

   Triinterp Demo

   Tripcolor Demo

   Triplot Demo

   Watermark image

   Axes box aspect

   Axes Demo

   Controlling view limits using margins and sticky_edges

   Axes Props

   axhspan Demo

   Equal axis aspect ratio

   Axis Label Position

   Broken Axis

   Placing Colorbars

   Resizing axes with constrained layout

   Resizing axes with tight layout

   Different scales on the same axes

   Figure size in different units

   Figure labels: suptitle, supxlabel, supylabel

   Creating adjacent subplots

   Combining two subplots using subplots and GridSpec

   Invert Axes

   Secondary Axis

   Figure subfigures

   Multiple subplots

   Creating multiple subplots using plt.subplots

   Plots with different scales

   Zoom region inset axes

   Percentiles as horizontal bar chart

   Artist customization in box plots

   Box plots with custom fill colors

   Boxplots

   Box plot vs. violin plot comparison

   Boxplot drawer function

   Plot a confidence ellipse of a two-dimensional dataset

   Violin plot customization

   Errorbar function

   Different ways of specifying error bars

   Including upper and lower limits in error bars

   Creating boxes from error bars using PatchCollection

   Hexagonal binned plot

   Histograms

   Using histograms to plot a cumulative distribution

   Some features of the histogram (hist) function

   Demo of the histogram function's different histtype settings

   The histogram (hist) function with multiple data sets

   Producing multiple histograms side by side

   Time Series Histogram

   Violin plot basics

   Basic pie chart

   Pie Demo2

   Bar of pie

   Nested pie charts

   Labeling a pie and a donut

   Polar plot

   Using accented text in matplotlib

   Scale invariant angle label

   Annotating Plots

   Composing Custom Legends

   Date tick labels

   Custom tick formatter for time series

   AnnotationBbox demo

   Using a text as a Path

   Labeling ticks using engineering notation

   Figure legend demo

   Configuring the font family

   Using a ttf font file in Matplotlib

   Font table

   Legend using pre-defined labels

   Legend Demo

   Artist within an artist

   Mathtext

   Math fontfamily

   Multiline

   Placing text boxes

   Rendering math equations using TeX

   Precise text layout

   Default text rotation demonstration

   Text Rotation Relative To Line

   Title positioning

   Text watermark

   Align y-labels

   Annotate Transform

   Annotating a plot

   Programmatically controlling subplot adjustment

   Boxplot Demo

   Dollar Ticks

   Color Demo

   Color by y-value

   Colors in the default property cycle

   Colorbar

   Colormap reference

   Creating a colormap from a list of colors

   List of named colors

   Arrow guide

   Reference for Matplotlib artists

   Line, Poly and RegularPoly Collection with autoscaling

   Compound path

   Dolphins

   Mmh Donuts!!!

   Ellipse Collection

   Ellipse Demo

   Drawing fancy boxes

   Hatch style reference

   Line Collection

   Circles, Wedges and Polygons

   PathPatch object

   Bezier Curve

   Bayesian Methods for Hackers style sheet

   Dark background style sheet

   FiveThirtyEight style sheet

   ggplot style sheet

   Grayscale style sheet

   Style sheets reference

   Anchored Direction Arrow

   HBoxDivider demo

   Showing RGB channels using RGBAxes

   Adding a colorbar to inset axes

   Colorbar with AxesDivider

   Controlling the position and size of colorbars with Inset Axes

   Inset Locator Demo

   Inset Locator Demo2

   Scatter Histogram (Locatable Axes)

   Simple Anchored Artists

   Bachelor's degrees by gender

   Integral as the area under a curve

   Decay

   Animated histogram

   pyplot animation

   The Bayes update

   Animated image using a precomputed list of images

   Pausing and Resuming an Animation

   Animated line plot

   Oscilloscope

   Mouse move and click events

   Data Browser

   Figure/Axes enter and leave events

   Image Slices Viewer

   Keypress event

   Legend Picking

   Looking Glass

   Path Editor

   Pick Event Demo

   Pick Event Demo2

   Poly Editor

   Pong

   Resampling Data

   Timers

   Trifinder Event Demo

   Viewlims

   Zoom Window

   Frontpage 3D example

   Frontpage contour example

   Frontpage histogram example

   Frontpage plot example

   Anchored Artists

   Changing colors of lines intersecting a box

   Manual Contour

   Coords Report

   Cross hair cursor

   Custom projection

   AGG filter

   Ribbon Box

   Findobj Demo

   Building histograms using Rectangles and PolyCollections

   Plotting with keywords

   Multiprocess

   Packed-bubble chart

   Patheffect Demo

   Pythonic Matplotlib

   Rasterization for vector graphics

   TickedStroke patheffect

   Zorder Demo

   Custom hillshading in a 3D surface plot

   3D stem

   3D surface (colormap)

   3D wireframe plots in one direction

   Loglog Aspect

   Log Bar

   Log Demo

   Log Axis

   Logit Demo

   Exploring normalizations

   Scales

   Symlog Demo

   Hillshading

   Anscombe's quartet

   Left ventricle bullseye

   MRI

   Radar chart (aka spider or star chart)

   Topographic hillshading

   Centered spines with arrows

   Multiple Yaxis With Spines

   Spines

   Custom spine bounds

   Dropped spines

   Automatically setting tick positions

   Centering labels between ticks

   Colorbar Tick Labelling

   Custom Ticker1

   Formatting date ticks using ConciseDateFormatter

   Date Demo Convert

   Placing date ticks using recurrence rules

   Date Index Formatter

   Date Precision and Epochs

   Major and minor ticks

   The default tick formatter

   Tick formatters

   Tick locators

   Set default y-axis tick labels on the right

   Setting tick labels from a list of values

   Set default x-axis tick labels on the top

   Annotation with units

   Artist tests

   Bar demo with units

   Group barchart with units

   Evans test

   Radian ticks

   Inches and Centimeters

   Unit handling

   pyplot with GTK3

   pyplot with GTK4

   SVG Tooltip

   Anchored Box04

   Annotate Explain

   Annotate Simple01

   Annotate Simple02

   Annotate Simple03

   Annotate Simple04

   Annotate Simple Coord01

   Annotate Simple Coord02

   Annotate Simple Coord03

   Annotate Text Arrow

   Interactive Adjustment of Colormap Range

   Colormap Normalizations

   Colormap Normalizations Symlognorm

   Connect Simple01

   Connection styles for annotations

   Custom box styles

   Pgf Fonts

   Pgf Preamble

   Pgf Texsystem

   Simple Annotate01

   Simple Legend02

   Annotated Cursor

   Buttons

   Check Buttons

   Cursor

   Lasso Selector

   Mouse Cursor

   Multicursor

   Polygon Selector

   Radio Buttons

   Thresholding an Image with RangeSlider

   Slider

   Snapping Sliders to Discrete Values

   Span Selector

   Textbox

   Basic Usage

   The Lifecycle of a Plot

   Artist tutorial

   Legend guide

   Styling with cycler

   Constrained Layout Guide

   Tight Layout guide

   Arranging multiple Axes in a Figure

   Autoscaling

   Faster rendering by using blitting

   Path Tutorial

   Transformations Tutorial

   Specifying Colors

   Customized Colorbars Tutorial

   Creating Colormaps in Matplotlib

   Colormap Normalization

   Choosing Colormaps in Matplotlib

   Text in Matplotlib Plots

   Annotations

   plot(x, y)

   scatter(x, y)

   bar(x, height) / barh(y, width)

   stem(x, y)

   step(x, y)

   fill_between(x, y1, y2)

   imshow(Z)

   pcolormesh(X, Y, Z)

   contour(X, Y, Z)

   contourf(X, Y, Z)

   barbs(X, Y, U, V)

   quiver(X, Y, U, V)

   streamplot(X, Y, U, V)

   hist(x)

   boxplot(X)

   errorbar(x, y, yerr, xerr)

   violinplot(D)

   eventplot(D)

   hist2d(x, y)

   hexbin(x, y, C)

   pie(x)

   tricontour(x, y, z)

   tricontourf(x, y, z)

   tripcolor(x, y, z)

   triplot(x, y)


matplotlib.pyplot.subplots_adjust   matplotlib.pyplot.subplots_adjust(left=None, bottom=None, right=None, top=None, wspace=None, hspace=None)[source]

Adjust the subplot layout parameters. Unset parameters are left unmodified; initial values are given by rcParams["figure.subplot.[name]"].  Parameters

leftfloat, optional

The position of the left edge of the subplots, as a fraction of the figure width.
rightfloat, optional

The position of the right edge of the subplots, as a fraction of the figure width.
bottomfloat, optional

The position of the bottom edge of the subplots, as a fraction of the figure height.
topfloat, optional

The position of the top edge of the subplots, as a fraction of the figure height.
wspacefloat, optional

The width of the padding between subplots, as a fraction of the average Axes width.
hspacefloat, optional

The height of the padding between subplots, as a fraction of the average Axes height.
  Examples using matplotlib.pyplot.subplots_adjust

   Contour plot of irregularly spaced data

   Subplots spacings and margins

   Violin plot customization

   Controlling style of text and labels using a dictionary

   Parasite axis demo

   Table Demo

   Rotating custom tick labels

   Buttons

   Check Buttons

   Radio Buttons

   Thresholding an Image with RangeSlider

   Slider

   Snapping Sliders to Discrete Values

   Pyplot tutorial


matplotlib.pyplot.summer   matplotlib.pyplot.summer()[source]

Set the colormap to 'summer'. This changes the default colormap as well as the colormap of the current image if there is one. See help(colormaps) for more information.


matplotlib.pyplot.suptitle   matplotlib.pyplot.suptitle(t, **kwargs)[source]

Add a centered suptitle to the figure.  Parameters

tstr

The suptitle text.
xfloat, default: 0.5

The x location of the text in figure coordinates.
yfloat, default: 0.98

The y location of the text in figure coordinates.
horizontalalignment, ha{'center', 'left', 'right'}, default: center

The horizontal alignment of the text relative to (x, y).
verticalalignment, va{'top', 'center', 'bottom', 'baseline'}, default: top

The vertical alignment of the text relative to (x, y).
fontsize, sizedefault: rcParams["figure.titlesize"] (default: 'large')

The font size of the text. See Text.set_size for possible values.
fontweight, weightdefault: rcParams["figure.titleweight"] (default: 'normal')

The font weight of the text. See Text.set_weight for possible values.    Returns
 text

The Text instance of the suptitle.    Other Parameters

fontpropertiesNone or dict, optional

A dict of font properties. If fontproperties is given the default values for font size and weight are taken from the FontProperties defaults. rcParams["figure.titlesize"] (default: 'large') and rcParams["figure.titleweight"] (default: 'normal') are ignored in this case.  **kwargs

Additional kwargs are matplotlib.text.Text properties.
  Examples using matplotlib.pyplot.suptitle

   Nested Gridspecs

   Pyplot tutorial

   Constrained Layout Guide


matplotlib.pyplot.switch_backend   matplotlib.pyplot.switch_backend(newbackend)[source]

Close all open figures and set the Matplotlib backend. The argument is case-insensitive. Switching to an interactive backend is possible only if no event loop for another interactive backend has started. Switching to and from non-interactive backends is always possible.  Parameters

newbackendstr

The name of the backend to use.


matplotlib.pyplot.table   matplotlib.pyplot.table(cellText=None, cellColours=None, cellLoc='right', colWidths=None, rowLabels=None, rowColours=None, rowLoc='left', colLabels=None, colColours=None, colLoc='center', loc='bottom', bbox=None, edges='closed', **kwargs)[source]

Add a table to an Axes. At least one of cellText or cellColours must be specified. These parameters must be 2D lists, in which the outer lists define the rows and the inner list define the column values per row. Each row must have the same number of elements. The table can optionally have row and column headers, which are configured using rowLabels, rowColours, rowLoc and colLabels, colColours, colLoc respectively. For finer grained control over tables, use the Table class and add it to the axes with Axes.add_table.  Parameters

cellText2D list of str, optional

The texts to place into the table cells. Note: Line breaks in the strings are currently not accounted for and will result in the text exceeding the cell boundaries.
cellColours2D list of colors, optional

The background colors of the cells.
cellLoc{'left', 'center', 'right'}, default: 'right'

The alignment of the text within the cells.
colWidthslist of float, optional

The column widths in units of the axes. If not given, all columns will have a width of 1 / ncols.
rowLabelslist of str, optional

The text of the row header cells.
rowColourslist of colors, optional

The colors of the row header cells.
rowLoc{'left', 'center', 'right'}, default: 'left'

The text alignment of the row header cells.
colLabelslist of str, optional

The text of the column header cells.
colColourslist of colors, optional

The colors of the column header cells.
colLoc{'left', 'center', 'right'}, default: 'left'

The text alignment of the column header cells.
locstr, optional

The position of the cell with respect to ax. This must be one of the codes.
bboxBbox, optional

A bounding box to draw the table into. If this is not None, this overrides loc.
edgessubstring of 'BRTL' or {'open', 'closed', 'horizontal', 'vertical'}

The cell edges to be drawn with a line. See also visible_edges.    Returns
 Table

The created table.    Other Parameters
 **kwargs

Table properties.
Property Description
agg_filter a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array
alpha scalar or None
animated bool
clip_box Bbox
clip_on bool
clip_path Patch or (Path, Transform) or None
figure Figure
fontsize float
gid str
in_layout bool
label object
path_effects AbstractPathEffect
picker None or bool or float or callable
rasterized bool
sketch_params (scale: float, length: float, randomness: float)
snap bool or None
transform Transform
url str
visible bool
zorder float
  Examples using matplotlib.pyplot.table

   Table Demo


matplotlib.pyplot.text   matplotlib.pyplot.text(x, y, s, fontdict=None, **kwargs)[source]

Add text to the Axes. Add the text s to the Axes at location x, y in data coordinates.  Parameters

x, yfloat

The position to place the text. By default, this is in data coordinates. The coordinate system can be changed using the transform parameter.
sstr

The text.
fontdictdict, default: None

A dictionary to override the default text properties. If fontdict is None, the defaults are determined by rcParams.    Returns
 Text

The created Text instance.    Other Parameters

**kwargsText properties.

Other miscellaneous text parameters.
Property Description
agg_filter a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array
alpha scalar or None
animated bool
backgroundcolor color
bbox dict with properties for patches.FancyBboxPatch
clip_box unknown
clip_on unknown
clip_path unknown
color or c color
figure Figure
fontfamily or family {FONTNAME, 'serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'}
fontproperties or font or font_properties font_manager.FontProperties or str or pathlib.Path
fontsize or size float or {'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'}
fontstretch or stretch {a numeric value in range 0-1000, 'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed', 'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'}
fontstyle or style {'normal', 'italic', 'oblique'}
fontvariant or variant {'normal', 'small-caps'}
fontweight or weight {a numeric value in range 0-1000, 'ultralight', 'light', 'normal', 'regular', 'book', 'medium', 'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy', 'extra bold', 'black'}
gid str
horizontalalignment or ha {'center', 'right', 'left'}
in_layout bool
label object
linespacing float (multiple of font size)
math_fontfamily str
multialignment or ma {'left', 'right', 'center'}
parse_math bool
path_effects AbstractPathEffect
picker None or bool or float or callable
position (float, float)
rasterized bool
rotation float or {'vertical', 'horizontal'}
rotation_mode {None, 'default', 'anchor'}
sketch_params (scale: float, length: float, randomness: float)
snap bool or None
text object
transform Transform
transform_rotates_text bool
url str
usetex bool or None
verticalalignment or va {'center', 'top', 'bottom', 'baseline', 'center_baseline'}
visible bool
wrap bool
x float
y float
zorder float       Examples Individual keyword arguments can be used to override any given parameter: >>> text(x, y, s, fontsize=12)
 The default transform specifies that text is in data coords, alternatively, you can specify text in axis coords ((0, 0) is lower-left and (1, 1) is upper-right). The example below places text in the center of the Axes: >>> text(0.5, 0.5, 'matplotlib', horizontalalignment='center',
...      verticalalignment='center', transform=ax.transAxes)
 You can put a rectangular box around the text instance (e.g., to set a background color) by using the keyword bbox. bbox is a dictionary of Rectangle properties. For example: >>> text(x, y, s, bbox=dict(facecolor='red', alpha=0.5))

  Examples using matplotlib.pyplot.text

   Figure size in different units

   Auto-wrapping text

   Styling text boxes

   Controlling style of text and labels using a dictionary

   Pyplot Mathtext

   Pyplot Text

   Reference for Matplotlib artists

   Close Event

   transforms.offset_copy

   Pyplot tutorial

   Path effects guide

   Text properties and layout

   Annotations


matplotlib.pyplot.thetagrids   matplotlib.pyplot.thetagrids(angles=None, labels=None, fmt=None, **kwargs)[source]

Get or set the theta gridlines on the current polar plot. Call signatures: lines, labels = thetagrids()
lines, labels = thetagrids(angles, labels=None, fmt=None, **kwargs)
 When called with no arguments, thetagrids simply returns the tuple (lines, labels). When called with arguments, the labels will appear at the specified angles.  Parameters

anglestuple with floats, degrees

The angles of the theta gridlines.
labelstuple with strings or None

The labels to use at each radial gridline. The projections.polar.ThetaFormatter will be used if None.
fmtstr or None

Format string used in matplotlib.ticker.FormatStrFormatter. For example '%f'. Note that the angle in radians will be used.    Returns

lineslist of lines.Line2D

The theta gridlines.
labelslist of text.Text

The tick labels.    Other Parameters
 **kwargs

kwargs are optional Text properties for the labels.      See also  pyplot.rgrids
projections.polar.PolarAxes.set_thetagrids
Axis.get_gridlines
Axis.get_ticklabels
  Examples # set the locations of the angular gridlines
lines, labels = thetagrids(range(45, 360, 90))

# set the locations and labels of the angular gridlines
lines, labels = thetagrids(range(45, 360, 90), ('NE', 'NW', 'SW', 'SE'))


matplotlib.pyplot.tick_params   matplotlib.pyplot.tick_params(axis='both', **kwargs)[source]

Change the appearance of ticks, tick labels, and gridlines. Tick properties that are not explicitly set using the keyword arguments remain unchanged unless reset is True.  Parameters

axis{'x', 'y', 'both'}, default: 'both'

The axis to which the parameters are applied.
which{'major', 'minor', 'both'}, default: 'major'

The group of ticks to which the parameters are applied.
resetbool, default: False

Whether to reset the ticks to defaults before updating them.    Other Parameters

direction{'in', 'out', 'inout'}

Puts ticks inside the axes, outside the axes, or both.
lengthfloat

Tick length in points.
widthfloat

Tick width in points.
colorcolor

Tick color.
padfloat

Distance in points between tick and label.
labelsizefloat or str

Tick label font size in points or as a string (e.g., 'large').
labelcolorcolor

Tick label color.
colorscolor

Tick color and label color.
zorderfloat

Tick and label zorder.
bottom, top, left, rightbool

Whether to draw the respective ticks.
labelbottom, labeltop, labelleft, labelrightbool

Whether to draw the respective tick labels.
labelrotationfloat

Tick label rotation
grid_colorcolor

Gridline color.
grid_alphafloat

Transparency of gridlines: 0 (transparent) to 1 (opaque).
grid_linewidthfloat

Width of gridlines in points.
grid_linestylestr

Any valid Line2D line style spec.     Examples ax.tick_params(direction='out', length=6, width=2, colors='r',
               grid_color='r', grid_alpha=0.5)
 This will make all major ticks be red, pointing out of the box, and with dimensions 6 points by 2 points. Tick labels will also be red. Gridlines will be red and translucent.
  Examples using matplotlib.pyplot.tick_params

   Shared Axis


matplotlib.pyplot.ticklabel_format   matplotlib.pyplot.ticklabel_format(*, axis='both', style='', scilimits=None, useOffset=None, useLocale=None, useMathText=None)[source]

Configure the ScalarFormatter used by default for linear axes. If a parameter is not set, the corresponding property of the formatter is left unchanged.  Parameters

axis{'x', 'y', 'both'}, default: 'both'

The axis to configure. Only major ticks are affected.
style{'sci', 'scientific', 'plain'}

Whether to use scientific notation. The formatter default is to use scientific notation.
scilimitspair of ints (m, n)

Scientific notation is used only for numbers outside the range 10m to 10n (and only if the formatter is configured to use scientific notation at all). Use (0, 0) to include all numbers. Use (m, m) where m != 0 to fix the order of magnitude to 10m. The formatter default is rcParams["axes.formatter.limits"] (default: [-5, 6]).
useOffsetbool or float

If True, the offset is calculated as needed. If False, no offset is used. If a numeric value, it sets the offset. The formatter default is rcParams["axes.formatter.useoffset"] (default: True).
useLocalebool

Whether to format the number using the current locale or using the C (English) locale. This affects e.g. the decimal separator. The formatter default is rcParams["axes.formatter.use_locale"] (default: False).
useMathTextbool

Render the offset and scientific notation in mathtext. The formatter default is rcParams["axes.formatter.use_mathtext"] (default: False).    Raises
 AttributeError

If the current formatter is not a ScalarFormatter.


matplotlib.pyplot.tight_layout   matplotlib.pyplot.tight_layout(*, pad=1.08, h_pad=None, w_pad=None, rect=None)[source]

Adjust the padding between and around subplots. To exclude an artist on the Axes from the bounding box calculation that determines the subplot parameters (i.e. legend, or annotation), set a.set_in_layout(False) for that artist.  Parameters

padfloat, default: 1.08

Padding between the figure edge and the edges of subplots, as a fraction of the font size.
h_pad, w_padfloat, default: pad

Padding (height/width) between edges of adjacent subplots, as a fraction of the font size.
recttuple (left, bottom, right, top), default: (0, 0, 1, 1)

A rectangle in normalized figure coordinates into which the whole subplots area (including labels) will fit.      See also  Figure.set_tight_layout
pyplot.tight_layout

  Examples using matplotlib.pyplot.tight_layout

   Linestyles

   Marker examples

   Creating annotated heatmaps

   Interpolations for imshow

   Streamplot

   Resizing axes with tight layout

   Labeling ticks using engineering notation

   Figure legend demo

   Reference for Matplotlib artists

   Zorder Demo

   3D wireframe plots in one direction

   MRI With EEG

   Tick locators

   Tight Layout guide


matplotlib.pyplot.title   matplotlib.pyplot.title(label, fontdict=None, loc=None, pad=None, *, y=None, **kwargs)[source]

Set a title for the Axes. Set one of the three available Axes titles. The available titles are positioned above the Axes in the center, flush with the left edge, and flush with the right edge.  Parameters

labelstr

Text to use for the title
fontdictdict

A dictionary controlling the appearance of the title text, the default fontdict is: {'fontsize': rcParams['axes.titlesize'],
 'fontweight': rcParams['axes.titleweight'],
 'color': rcParams['axes.titlecolor'],
 'verticalalignment': 'baseline',
 'horizontalalignment': loc}

loc{'center', 'left', 'right'}, default: rcParams["axes.titlelocation"] (default: 'center')

Which title to set.
yfloat, default: rcParams["axes.titley"] (default: None)

Vertical Axes loation for the title (1.0 is the top). If None (the default), y is determined automatically to avoid decorators on the Axes.
padfloat, default: rcParams["axes.titlepad"] (default: 6.0)

The offset of the title from the top of the Axes, in points.    Returns
 Text

The matplotlib text instance representing the title    Other Parameters

**kwargsText properties

Other keyword arguments are text properties, see Text for a list of valid text properties.
  Examples using matplotlib.pyplot.title

   prop_cycle property markevery in rcParams

   Plotting masked and NaN values

   Stairs Demo

   Step Demo

   Geographic Projections

   Multiple subplots

   Controlling style of text and labels using a dictionary

   Title positioning

   Pyplot Mathtext

   Pyplot Text

   Solarized Light stylesheet

   Interactive functions

   Findobj Demo

   Multipage PDF

   Set and get properties

   Table Demo

   Zorder Demo

   Custom scale

   The Sankey class

   SVG Histogram

   Basic Usage

   Pyplot tutorial


matplotlib.pyplot.tricontour   matplotlib.pyplot.tricontour(*args, **kwargs)[source]

Draw contour lines on an unstructured triangular grid. The triangulation can be specified in one of two ways; either tricontour(triangulation, ...)
 where triangulation is a Triangulation object, or tricontour(x, y, ...)
tricontour(x, y, triangles, ...)
tricontour(x, y, triangles=triangles, ...)
tricontour(x, y, mask=mask, ...)
tricontour(x, y, triangles, mask=mask, ...)
 in which case a Triangulation object will be created. See that class' docstring for an explanation of these cases. The remaining arguments may be: tricontour(..., Z)
 where Z is the array of values to contour, one per point in the triangulation. The level values are chosen automatically. tricontour(..., Z, levels)
 contour up to levels+1 automatically chosen contour levels (levels intervals). tricontour(..., Z, levels)
 draw contour lines at the values specified in sequence levels, which must be in increasing order. tricontour(Z, **kwargs)
 Use keyword arguments to control colors, linewidth, origin, cmap ... see below for more details.  Parameters

triangulationTriangulation, optional

The unstructured triangular grid. If specified, then x, y, triangles, and mask are not accepted.
x, yarray-like, optional

The coordinates of the values in Z.
triangles(ntri, 3) array-like of int, optional

For each triangle, the indices of the three points that make up the triangle, ordered in an anticlockwise manner. If not specified, the Delaunay triangulation is calculated.
mask(ntri,) array-like of bool, optional

Which triangles are masked out.
Z2D array-like

The height values over which the contour is drawn.
levelsint or array-like, optional

Determines the number and positions of the contour lines / regions. If an int n, use MaxNLocator, which tries to automatically choose no more than n+1 "nice" contour levels between vmin and vmax. If array-like, draw contour lines at the specified levels. The values must be in increasing order.    Returns
 TriContourSet
  Other Parameters

colorscolor string or sequence of colors, optional

The colors of the levels, i.e., the contour lines. The sequence is cycled for the levels in ascending order. If the sequence is shorter than the number of levels, it's repeated. As a shortcut, single color strings may be used in place of one-element lists, i.e. 'red' instead of ['red'] to color all levels with the same color. This shortcut does only work for color strings, not for other ways of specifying colors. By default (value None), the colormap specified by cmap will be used.
alphafloat, default: 1

The alpha blending value, between 0 (transparent) and 1 (opaque).
cmapstr or Colormap, default: rcParams["image.cmap"] (default: 'viridis')

A Colormap instance or registered colormap name. The colormap maps the level values to colors. If both colors and cmap are given, an error is raised.
normNormalize, optional

If a colormap is used, the Normalize instance scales the level values to the canonical colormap range [0, 1] for mapping to colors. If not given, the default linear scaling is used.
vmin, vmaxfloat, optional

If not None, either or both of these values will be supplied to the Normalize instance, overriding the default color scaling based on levels.
origin{None, 'upper', 'lower', 'image'}, default: None

Determines the orientation and exact position of Z by specifying the position of Z[0, 0]. This is only relevant, if X, Y are not given.
None: Z[0, 0] is at X=0, Y=0 in the lower left corner. 'lower': Z[0, 0] is at X=0.5, Y=0.5 in the lower left corner. 'upper': Z[0, 0] is at X=N+0.5, Y=0.5 in the upper left corner. 'image': Use the value from rcParams["image.origin"] (default: 'upper').
extent(x0, x1, y0, y1), optional

If origin is not None, then extent is interpreted as in imshow: it gives the outer pixel boundaries. In this case, the position of Z[0, 0] is the center of the pixel, not a corner. If origin is None, then (x0, y0) is the position of Z[0, 0], and (x1, y1) is the position of Z[-1, -1]. This argument is ignored if X and Y are specified in the call to contour.
locatorticker.Locator subclass, optional

The locator is used to determine the contour levels if they are not given explicitly via levels. Defaults to MaxNLocator.
extend{'neither', 'both', 'min', 'max'}, default: 'neither'

Determines the tricontour-coloring of values that are outside the levels range. If 'neither', values outside the levels range are not colored. If 'min', 'max' or 'both', color the values below, above or below and above the levels range. Values below min(levels) and above max(levels) are mapped to the under/over values of the Colormap. Note that most colormaps do not have dedicated colors for these by default, so that the over and under values are the edge values of the colormap. You may want to set these values explicitly using Colormap.set_under and Colormap.set_over.  Note An existing TriContourSet does not get notified if properties of its colormap are changed. Therefore, an explicit call to ContourSet.changed() is needed after modifying the colormap. The explicit call can be left out, if a colorbar is assigned to the TriContourSet because it internally calls ContourSet.changed().
xunits, yunitsregistered units, optional

Override axis units by specifying an instance of a matplotlib.units.ConversionInterface.
antialiasedbool, optional

Enable antialiasing, overriding the defaults. For filled contours, the default is True. For line contours, it is taken from rcParams["lines.antialiased"] (default: True).
linewidthsfloat or array-like, default: rcParams["contour.linewidth"] (default: None)

The line width of the contour lines. If a number, all levels will be plotted with this linewidth. If a sequence, the levels in ascending order will be plotted with the linewidths in the order specified. If None, this falls back to rcParams["lines.linewidth"] (default: 1.5).
linestyles{None, 'solid', 'dashed', 'dashdot', 'dotted'}, optional

If linestyles is None, the default is 'solid' unless the lines are monochrome. In that case, negative contours will take their linestyle from rcParams["contour.negative_linestyle"] (default: 'dashed') setting. linestyles can also be an iterable of the above strings specifying a set of linestyles to be used. If this iterable is shorter than the number of contour levels it will be repeated as necessary.


matplotlib.pyplot.tricontourf   matplotlib.pyplot.tricontourf(*args, **kwargs)[source]

Draw contour regions on an unstructured triangular grid. The triangulation can be specified in one of two ways; either tricontourf(triangulation, ...)
 where triangulation is a Triangulation object, or tricontourf(x, y, ...)
tricontourf(x, y, triangles, ...)
tricontourf(x, y, triangles=triangles, ...)
tricontourf(x, y, mask=mask, ...)
tricontourf(x, y, triangles, mask=mask, ...)
 in which case a Triangulation object will be created. See that class' docstring for an explanation of these cases. The remaining arguments may be: tricontourf(..., Z)
 where Z is the array of values to contour, one per point in the triangulation. The level values are chosen automatically. tricontourf(..., Z, levels)
 contour up to levels+1 automatically chosen contour levels (levels intervals). tricontourf(..., Z, levels)
 draw contour regions at the values specified in sequence levels, which must be in increasing order. tricontourf(Z, **kwargs)
 Use keyword arguments to control colors, linewidth, origin, cmap ... see below for more details.  Parameters

triangulationTriangulation, optional

The unstructured triangular grid. If specified, then x, y, triangles, and mask are not accepted.
x, yarray-like, optional

The coordinates of the values in Z.
triangles(ntri, 3) array-like of int, optional

For each triangle, the indices of the three points that make up the triangle, ordered in an anticlockwise manner. If not specified, the Delaunay triangulation is calculated.
mask(ntri,) array-like of bool, optional

Which triangles are masked out.
Z2D array-like

The height values over which the contour is drawn.
levelsint or array-like, optional

Determines the number and positions of the contour lines / regions. If an int n, use MaxNLocator, which tries to automatically choose no more than n+1 "nice" contour levels between vmin and vmax. If array-like, draw contour lines at the specified levels. The values must be in increasing order.    Returns
 TriContourSet
  Other Parameters

colorscolor string or sequence of colors, optional

The colors of the levels, i.e., the contour regions. The sequence is cycled for the levels in ascending order. If the sequence is shorter than the number of levels, it's repeated. As a shortcut, single color strings may be used in place of one-element lists, i.e. 'red' instead of ['red'] to color all levels with the same color. This shortcut does only work for color strings, not for other ways of specifying colors. By default (value None), the colormap specified by cmap will be used.
alphafloat, default: 1

The alpha blending value, between 0 (transparent) and 1 (opaque).
cmapstr or Colormap, default: rcParams["image.cmap"] (default: 'viridis')

A Colormap instance or registered colormap name. The colormap maps the level values to colors. If both colors and cmap are given, an error is raised.
normNormalize, optional

If a colormap is used, the Normalize instance scales the level values to the canonical colormap range [0, 1] for mapping to colors. If not given, the default linear scaling is used.
vmin, vmaxfloat, optional

If not None, either or both of these values will be supplied to the Normalize instance, overriding the default color scaling based on levels.
origin{None, 'upper', 'lower', 'image'}, default: None

Determines the orientation and exact position of Z by specifying the position of Z[0, 0]. This is only relevant, if X, Y are not given.
None: Z[0, 0] is at X=0, Y=0 in the lower left corner. 'lower': Z[0, 0] is at X=0.5, Y=0.5 in the lower left corner. 'upper': Z[0, 0] is at X=N+0.5, Y=0.5 in the upper left corner. 'image': Use the value from rcParams["image.origin"] (default: 'upper').
extent(x0, x1, y0, y1), optional

If origin is not None, then extent is interpreted as in imshow: it gives the outer pixel boundaries. In this case, the position of Z[0, 0] is the center of the pixel, not a corner. If origin is None, then (x0, y0) is the position of Z[0, 0], and (x1, y1) is the position of Z[-1, -1]. This argument is ignored if X and Y are specified in the call to contour.
locatorticker.Locator subclass, optional

The locator is used to determine the contour levels if they are not given explicitly via levels. Defaults to MaxNLocator.
extend{'neither', 'both', 'min', 'max'}, default: 'neither'

Determines the tricontourf-coloring of values that are outside the levels range. If 'neither', values outside the levels range are not colored. If 'min', 'max' or 'both', color the values below, above or below and above the levels range. Values below min(levels) and above max(levels) are mapped to the under/over values of the Colormap. Note that most colormaps do not have dedicated colors for these by default, so that the over and under values are the edge values of the colormap. You may want to set these values explicitly using Colormap.set_under and Colormap.set_over.  Note An existing TriContourSet does not get notified if properties of its colormap are changed. Therefore, an explicit call to ContourSet.changed() is needed after modifying the colormap. The explicit call can be left out, if a colorbar is assigned to the TriContourSet because it internally calls ContourSet.changed().
xunits, yunitsregistered units, optional

Override axis units by specifying an instance of a matplotlib.units.ConversionInterface.
antialiasedbool, optional

Enable antialiasing, overriding the defaults. For filled contours, the default is True. For line contours, it is taken from rcParams["lines.antialiased"] (default: True).
hatcheslist[str], optional

A list of cross hatch patterns to use on the filled areas. If None, no hatching will be added to the contour. Hatching is supported in the PostScript, PDF, SVG and Agg backends only.     Notes tricontourf fills intervals that are closed at the top; that is, for boundaries z1 and z2, the filled region is: z1 < Z <= z2
 except for the lowest interval, which is closed on both sides (i.e. it includes the lowest value).