:orphan:


.. _examples-index:

.. _gallery:

========
Examples
========
For an overview of the plotting methods we provide, see :ref:`plot_types`

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

For longer tutorials, see our :ref:`tutorials page <tutorials>`.
You can also find :ref:`external resources <resources-index>` and
a :ref:`FAQ <howto-faq>` in our :ref:`user guide <users-guide-index>`.


.. admonition:: Tagging!

    You can also browse the example gallery by :ref:`tags <tagoverview>`.



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. thumbnail-parent-div-close

.. raw:: html

    </div>


Lines, bars and markers
=======================



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="axvline and axhline draw infinite vertical / horizontal lines, at given x / y positions. They are usually used to mark special data values, e.g. in this example the center and limit values of the sigmoid function.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_axline_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_axline.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Infinite lines</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This is an example showing how to control bar color and legend entries using the color and label parameters of bar. Note that labels with a preceding underscore won&#x27;t show up in the legend.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_bar_colors_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_bar_colors.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Bar chart with individual bar colors</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows how to use the bar_label helper function to create bar chart labels.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_bar_label_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_bar_label_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Bar chart with labels</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This is an example of creating a stacked bar plot using bar.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_bar_stacked_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_bar_stacked.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Stacked bar chart</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows a how to create a grouped bar chart and how to annotate bars with labels.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_barchart_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_barchart.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Grouped bar chart with labels</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example showcases a simple horizontal bar chart.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_barh_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_barh.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Horizontal bar chart</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="broken_barh creates sequences of horizontal bars. This example shows a timing diagram.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_broken_barh_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_broken_barh.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Broken horizontal bars</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The matplotlib._enums.CapStyle controls how Matplotlib draws the two endpoints (caps) of an unclosed line. For more details, see the CapStyle docs.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_capstyle_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_capstyle.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">CapStyle</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="You can pass categorical values (i.e. strings) directly as x- or y-values to many plotting functions:">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_categorical_variables_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_categorical_variables.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Plotting categorical variables</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="An example showing how to plot the coherence of two signals using cohere.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_cohere_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_cohere.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Plotting the coherence of two signals</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Plot the cross spectral density (CSD) of two signals using csd.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_csd_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_csd_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Cross spectral density (CSD)</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example illustrates how to draw an error band around a parametrized curve.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_curve_error_band_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_curve_error_band.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Curve with error band</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Illustration of selectively drawing lower and/or upper limit symbols on errorbars using the parameters uplims, lolims of errorbar.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_errorbar_limits_simple_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_errorbar_limits_simple.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Errorbar limit selection</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The parameter errorevery of Axes.errorbar can be used to draw error bars only on a subset of data points. This is particularly useful if there are many data points with similar errors.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_errorbar_subsample_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_errorbar_subsample.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Errorbar subsampling</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Plot two curves, then use EventCollection\s to mark the locations of the x and y data points on the respective Axes for each curve.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_eventcollection_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_eventcollection_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">EventCollection Demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="An eventplot showing sequences of events with various line properties. The plot is shown in both horizontal and vertical orientations.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_eventplot_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_eventplot_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Eventplot demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="fill() draws a filled polygon based on lists of point coordinates x, y.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_fill_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_fill.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Filled polygon</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The fill_between function generates a shaded region between a min and max boundary that is useful for illustrating ranges. It has a very handy where argument to combine filling with logical ranges, e.g., to just fill in a curve over some threshold value.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_fill_between_alpha_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_fill_between_alpha.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">fill_between with transparency</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows how to use fill_between to color the area between two lines.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_fill_between_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_fill_between_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Fill the area between two lines</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Using fill_betweenx to color along the horizontal direction between two curves.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_fill_betweenx_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_fill_betweenx_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Fill the area between two vertical lines</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Matplotlib does not natively support gradients. However, we can emulate a gradient-filled rectangle by an AxesImage of the right size and coloring.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_gradient_bar_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_gradient_bar.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Bar chart with gradients</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Hat graph">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_hat_graph_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_hat_graph.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Hat graph</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Stacked bar charts can be used to visualize discrete distributions.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_horizontal_barchart_distribution_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_horizontal_barchart_distribution.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Discrete distribution as horizontal bar chart</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The matplotlib._enums.JoinStyle controls how Matplotlib draws the corners where two different line segments meet. For more details, see the JoinStyle docs.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_joinstyle_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_joinstyle.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">JoinStyle</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The dashing of a line is controlled via a dash sequence. It can be modified using Line2D.set_dashes.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_line_demo_dash_control_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_line_demo_dash_control.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Dashed line style configuration</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Ticks can be added along a line to mark one side as a barrier using TickedStroke.  You can control the angle, spacing, and length of the ticks.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_lines_with_ticks_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_lines_with_ticks_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Lines with a ticked patheffect</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Simple linestyles can be defined using the strings &quot;solid&quot;, &quot;dotted&quot;, &quot;dashed&quot; or &quot;dashdot&quot;. More refined control can be achieved by providing a dash tuple (offset, (on_off_seq)). For example, (0, (3, 10, 1, 15)) means (3pt line, 10pt space, 1pt line, 15pt space) with no offset, while (5, (10, 3)), means (10pt line, 3pt space), but skip the first 5pt line. See also Line2D.set_linestyle.  The specific on/off sequences of the &quot;dotted&quot;, &quot;dashed&quot; and &quot;dashdot&quot; styles are configurable:">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_linestyles_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_linestyles.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Linestyles</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Matplotlib supports multiple categories of markers which are selected using the marker parameter of plot commands:">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_marker_reference_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_marker_reference.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Marker reference</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The markevery property of Line2D allows drawing markers at a subset of data points.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_markevery_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_markevery_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Markevery Demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Sometimes you need to plot data with missing values.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_masked_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_masked_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Plotting masked and NaN values</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The example shows two ways to plot a line with the a varying color defined by a third value. The first example defines the color at each (x, y) point. The second example defines the color between pairs of points, so the length of the color value list is one less than the length of the x and y lists.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_multicolored_line_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_multicolored_line.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Multicolored lines</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows how to use different properties of markers to plot multivariate datasets. Here we represent a successful baseball throw as a smiley face with marker size mapped to the skill of thrower, marker rotation to the take-off angle, and thrust to the marker color.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_multivariate_marker_plot_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_multivariate_marker_plot.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Mapping marker properties to multivariate data</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Plotting power spectral density (PSD) using psd.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_psd_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_psd_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Power spectral density (PSD)</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demo of scatter plot with varying marker colors and sizes.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_scatter_demo2_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_scatter_demo2.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Scatter Demo2</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Add histograms to the x-axes and y-axes margins of a scatter plot.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_scatter_hist_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_scatter_hist.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Scatter plot with histograms</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Mask some data points and add a line demarking masked regions.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_scatter_masked_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_scatter_masked.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Scatter plot with masked values</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Example with different ways to specify markers.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_scatter_star_poly_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_scatter_star_poly.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Marker examples</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="To create a scatter plot with a legend one may use a loop and create one scatter plot per item to appear in the legend and set the label accordingly.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_scatter_with_legend_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_scatter_with_legend.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Scatter plot with a legend</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Create a basic line plot.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_simple_plot_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_simple_plot.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Line plot</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Shade regions defined by a logical mask using fill_between">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_span_regions_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_span_regions.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Shade regions defined by a logical mask using fill_between</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The plots show different spectrum representations of a sine signal with additive noise. A (frequency) spectrum of a discrete-time signal is calculated by utilizing the fast Fourier transform (FFT).">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_spectrum_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_spectrum_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Spectrum representations</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Stackplots and streamgraphs">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_stackplot_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_stackplot_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Stackplots and streamgraphs</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates the use of stairs for stepwise constant functions. A common use case is histogram and histogram-like data visualization.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_stairs_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_stairs_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Stairs Demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="stem plots vertical lines from a baseline to the y-coordinate and places a marker at the tip.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_stem_plot_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_stem_plot.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Stem plot</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates the use of pyplot.step for piece-wise constant curves. In particular, it illustrates the effect of the parameter where on the step position.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_step_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_step_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Step Demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="How to create a simple timeline using Matplotlib release dates.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_timeline_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_timeline.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Timeline with lines, dates, and text</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example showcases the functions hlines and vlines.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_vline_hline_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_vline_hline_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">hlines and vlines</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Example use of cross-correlation (`~.Axes.xcorr`) and auto-correlation (`~.Axes.acorr`) plots.">

.. only:: html

  .. image:: /gallery/lines_bars_and_markers/images/thumb/sphx_glr_xcorr_acorr_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_lines_bars_and_markers_xcorr_acorr_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Cross- and auto-correlation</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


Images, contours and fields
===========================



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip=" Prepending an affine transformation (`~.transforms.Affine2D`) to the data transform &lt;data-coords&gt; of an image allows to manipulate the image&#x27;s shape and orientation.  This is an example of the concept of transform chaining &lt;transformation-pipeline&gt;.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_affine_image_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_affine_image.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Affine transform of an image</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstration of wind barb plots.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_barb_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_barb_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Wind barbs</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The figure size is calculated so that the width in pixels is a multiple of the number of data points to prevent interpolation artifacts. Additionally, the Axes is defined to span the whole figure and all Axis are turned off.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_barcode_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_barcode_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Barcode</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstration of how a colorbar can be used to interactively adjust the range of colormapping on an image. To use the interactive feature, you must be in either zoom mode (magnifying glass toolbar button) or pan mode (4-way arrow toolbar button) and click inside the colorbar.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_colormap_interactive_adjustment_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_colormap_interactive_adjustment.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Interactive adjustment of colormap range</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstration of using norm to map colormaps onto data in non-linear ways.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_colormap_normalizations_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_colormap_normalizations.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Colormap normalizations</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstration of using norm to map colormaps onto data in non-linear ways.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_colormap_normalizations_symlognorm_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_colormap_normalizations_symlognorm.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Colormap normalizations SymLogNorm</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Illustrate the difference between corner_mask=False and corner_mask=True for masked contour plots.  The default is controlled by contour.corner_mask.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_contour_corner_mask_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_contour_corner_mask.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Contour corner mask</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Illustrate simple contour plotting, contours on an image with a colorbar for the contours, and labelled contours.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_contour_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_contour_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Contour Demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Test combinations of contouring, filled contouring, and image plotting. For contour labelling, see also the contour demo example &lt;/gallery/images_contours_and_fields/contour_demo&gt;.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_contour_image_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_contour_image.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Contour image</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Illustrate some of the more advanced things that one can do with contour labels.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_contour_label_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_contour_label_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Contour Label Demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="How to use the axes.Axes.contourf method to create filled contour plots.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_contourf_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_contourf_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Contourf demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demo filled contour plots with hatched patterns.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_contourf_hatching_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_contourf_hatching.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Contourf hatching</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrate use of a log color scale in contourf">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_contourf_log_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_contourf_log.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Contourf and log color scale</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Contour plotting is particularly handy when illustrating the solution space of optimization problems.  Not only can axes.Axes.contour be used to represent the topography of the objective function, it can be used to generate boundary curves of the constraint functions.  The constraint lines can be drawn with TickedStroke to distinguish the valid and invalid sides of the constraint boundaries.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_contours_in_optimization_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_contours_in_optimization_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Contouring the solution space of optimizations</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="A BboxImage can be used to position an image according to a bounding box. This demo shows how to show an image inside a text.Text&#x27;s bounding box as well as how to manually create a bounding box for the image.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_demo_bboximage_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_demo_bboximage.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">BboxImage Demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This illustrates placing images directly in the figure, with no Axes objects.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_figimage_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_figimage_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Figimage Demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="It is often desirable to show data which depends on two independent variables as a color coded image plot. This is often referred to as a heatmap. If the data is categorical, this would be called a categorical heatmap.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_image_annotated_heatmap_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_image_annotated_heatmap.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Annotated heatmap</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Images are represented by discrete pixels assigned color values, either on the screen or in an image file.  When a user calls imshow with a data array, it is rare that the size of the data array exactly matches the number of pixels allotted to the image in the figure, so Matplotlib resamples or scales the data or image to fit.  If the data array is larger than the number of pixels allotted in the rendered figure, then the image will be &quot;down-sampled&quot; and image information will be lost. Conversely, if the data array is smaller than the number of output pixels then each data point will get multiple pixels, and the image is &quot;up-sampled&quot;.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_image_antialiasing_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_image_antialiasing.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Image resampling</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demo of image that&#x27;s been clipped by a circular patch.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_image_clip_path_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_image_clip_path.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Clipping images with patches</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The most common way to plot images in Matplotlib is with imshow. The following examples demonstrate much of the functionality of imshow and the many images you can create.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_image_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_image_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Many ways to plot images</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="imshow with masked array input and out-of-range colors.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_image_masked_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_image_masked.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Image with masked values</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="NonUniformImage is a generalized image with pixels on a rectilinear grid, i.e. it allows rows and columns with individual heights / widths.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_image_nonuniform_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_image_nonuniform.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Image nonuniform</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Blend transparency with color to highlight parts of data with imshow.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_image_transparency_blend_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_image_transparency_blend.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Blend transparency with color in 2D images</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Modify the coordinate formatter to report the image &quot;z&quot; value of the nearest pixel given x and y.  This functionality is built in by default; this example just showcases how to customize the format_coord function.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_image_zcoord_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_image_zcoord.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Modifying the coordinate formatter</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example displays the difference between interpolation methods for imshow.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_interpolation_methods_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_interpolation_methods.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Interpolations for imshow</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Comparison of a contour plot of irregularly spaced data interpolated on a regular grid versus a tricontour plot for an unstructured triangular grid.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_irregulardatagrid_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_irregulardatagrid.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Contour plot of irregularly spaced data</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Layer images above one another using alpha blending">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_layer_images_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_layer_images.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Layer images with alpha blending</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="matshow visualizes a 2D matrix or array as color-coded image.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_matshow_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_matshow.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Visualize matrices with matshow</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Use a single colorbar for multiple images.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_multi_image_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_multi_image.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Multiple images with one colorbar</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="pcolor generates 2D image-style plots, as illustrated below.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_pcolor_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_pcolor_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">pcolor images</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="axes.Axes.pcolormesh and pcolor have a few options for how grids are laid out and the shading between the grid points.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_pcolormesh_grids_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_pcolormesh_grids.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">pcolormesh grids and shading</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="axes.Axes.pcolormesh allows you to generate 2D image-style plots. Note that it is faster than the similar pcolor.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_pcolormesh_levels_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_pcolormesh_levels.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">pcolormesh</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="A stream plot, or streamline plot, is used to display 2D vector fields. This example shows a few features of the streamplot function:">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_plot_streamplot_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_plot_streamplot.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Streamplot</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="pcolormesh uses a QuadMesh, a faster generalization of pcolor, but with some restrictions.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_quadmesh_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_quadmesh_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">QuadMesh Demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrates some more advanced options for quiver.  For a simple example refer to /gallery/images_contours_and_fields/quiver_simple_demo.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_quiver_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_quiver_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Advanced quiver and quiverkey functions</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="A simple example of a quiver plot with a quiverkey.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_quiver_simple_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_quiver_simple_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Quiver Simple Demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Example showing how to make shaded relief plots like Mathematica_ or `Generic Mapping Tools`_.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_shading_example_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_shading_example.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Shading example</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Plotting a spectrogram using specgram.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_specgram_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_specgram_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Spectrogram</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Plot the sparsity pattern of arrays.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_spy_demos_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_spy_demos.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Spy Demos</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Contour plots of unstructured triangular grids.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_tricontour_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_tricontour_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Tricontour Demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrates high-resolution tricontouring of a random set of points; a matplotlib.tri.TriAnalyzer is used to improve the plot quality.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_tricontour_smooth_delaunay_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_tricontour_smooth_delaunay.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Tricontour Smooth Delaunay</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrates high-resolution tricontouring on user-defined triangular grids with matplotlib.tri.UniformTriRefiner.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_tricontour_smooth_user_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_tricontour_smooth_user.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Tricontour Smooth User</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrates computation of gradient with matplotlib.tri.CubicTriInterpolator.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_trigradient_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_trigradient_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Trigradient Demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Interpolation from triangular grid to quad grid.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_triinterp_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_triinterp_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Triinterp Demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Pseudocolor plots of unstructured triangular grids.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_tripcolor_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_tripcolor_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Tripcolor Demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Creating and plotting unstructured triangular grids.">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_triplot_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_triplot_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Triplot Demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Overlay an image on a plot by moving it to the front (``zorder=3``) and making it semi-transparent (``alpha=0.7``).">

.. only:: html

  .. image:: /gallery/images_contours_and_fields/images/thumb/sphx_glr_watermark_image_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_images_contours_and_fields_watermark_image.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Watermark image</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


Subplots, axes and figures
==========================



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Aligning xlabel, ylabel, and title using Figure.align_xlabels, Figure.align_ylabels, and Figure.align_titles.">

.. only:: html

  .. image:: /gallery/subplots_axes_and_figures/images/thumb/sphx_glr_align_labels_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_subplots_axes_and_figures_align_labels_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Align labels and titles</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="    This example is primarily intended to show some advanced concepts in     Matplotlib.">

.. only:: html

  .. image:: /gallery/subplots_axes_and_figures/images/thumb/sphx_glr_auto_subplots_adjust_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_subplots_axes_and_figures_auto_subplots_adjust.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Programmatically control subplot adjustment</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This demo shows how to set the aspect of an Axes box directly via set_box_aspect. The box aspect is the ratio between Axes height and Axes width in physical units, independent of the data limits. This is useful to e.g. produce a square plot, independent of the data it contains, or to have a usual plot with the same axes dimensions next to an image plot with fixed (data-)aspect.">

.. only:: html

  .. image:: /gallery/subplots_axes_and_figures/images/thumb/sphx_glr_axes_box_aspect_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_subplots_axes_and_figures_axes_box_aspect.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Axes box aspect</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Example use of fig.add_axes to create inset Axes within the main plot Axes.">

.. only:: html

  .. image:: /gallery/subplots_axes_and_figures/images/thumb/sphx_glr_axes_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_subplots_axes_and_figures_axes_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Axes Demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The first figure in this example shows how to zoom in and out of a plot using margins instead of set_xlim and set_ylim. The second figure demonstrates the concept of edge &quot;stickiness&quot; introduced by certain methods and artists and how to effectively work around that.">

.. only:: html

  .. image:: /gallery/subplots_axes_and_figures/images/thumb/sphx_glr_axes_margins_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_subplots_axes_and_figures_axes_margins.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Controlling view limits using margins and sticky_edges</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="You can control the axis tick and grid properties">

.. only:: html

  .. image:: /gallery/subplots_axes_and_figures/images/thumb/sphx_glr_axes_props_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_subplots_axes_and_figures_axes_props.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Axes properties</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Axes zoom effect">

.. only:: html

  .. image:: /gallery/subplots_axes_and_figures/images/thumb/sphx_glr_axes_zoom_effect_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_subplots_axes_and_figures_axes_zoom_effect.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Axes zoom effect</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="axhspan and axvspan draw rectangles that span the Axes in either the horizontal or vertical direction and are bounded in the other direction. They are often used to highlight data regions.">

.. only:: html

  .. image:: /gallery/subplots_axes_and_figures/images/thumb/sphx_glr_axhspan_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_subplots_axes_and_figures_axhspan_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Draw regions that span an Axes</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="How to set and adjust plots with equal axis aspect ratios.">

.. only:: html

  .. image:: /gallery/subplots_axes_and_figures/images/thumb/sphx_glr_axis_equal_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_subplots_axes_and_figures_axis_equal_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Equal axis aspect ratio</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Choose axis label position when calling set_xlabel and set_ylabel as well as for colorbar.">

.. only:: html

  .. image:: /gallery/subplots_axes_and_figures/images/thumb/sphx_glr_axis_labels_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_subplots_axes_and_figures_axis_labels_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Axis label position</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Broken axis example, where the y-axis will have a portion cut out.">

.. only:: html

  .. image:: /gallery/subplots_axes_and_figures/images/thumb/sphx_glr_broken_axis_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_subplots_axes_and_figures_broken_axis.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Broken axis</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="You can pass a Figure subclass to pyplot.figure if you want to change the default behavior of the figure.">

.. only:: html

  .. image:: /gallery/subplots_axes_and_figures/images/thumb/sphx_glr_custom_figure_class_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_subplots_axes_and_figures_custom_figure_class.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Custom Figure subclasses</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Constrained layout attempts to resize subplots in a figure so that there are no overlaps between Axes objects and labels on the Axes.">

.. only:: html

  .. image:: /gallery/subplots_axes_and_figures/images/thumb/sphx_glr_demo_constrained_layout_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_subplots_axes_and_figures_demo_constrained_layout.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Resize Axes with constrained layout</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="tight_layout attempts to resize subplots in a figure so that there are no overlaps between Axes objects and labels on the Axes.">

.. only:: html

  .. image:: /gallery/subplots_axes_and_figures/images/thumb/sphx_glr_demo_tight_layout_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_subplots_axes_and_figures_demo_tight_layout.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Resize Axes with tight layout</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demo of how to display two scales on the left and right y-axis.">

.. only:: html

  .. image:: /gallery/subplots_axes_and_figures/images/thumb/sphx_glr_fahrenheit_celsius_scales_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_subplots_axes_and_figures_fahrenheit_celsius_scales.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Different scales on the same Axes</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The native figure size unit in Matplotlib is inches, deriving from print industry standards. However, users may need to specify their figures in other units like centimeters or pixels. This example illustrates how to do this efficiently.">

.. only:: html

  .. image:: /gallery/subplots_axes_and_figures/images/thumb/sphx_glr_figure_size_units_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_subplots_axes_and_figures_figure_size_units.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Figure size in different units</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Each Axes can have a title (or actually three - one each with loc &quot;left&quot;, &quot;center&quot;, and &quot;right&quot;), but is sometimes desirable to give a whole figure (or SubFigure) an overall title, using Figure.suptitle.">

.. only:: html

  .. image:: /gallery/subplots_axes_and_figures/images/thumb/sphx_glr_figure_title_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_subplots_axes_and_figures_figure_title.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Figure labels: suptitle, supxlabel, supylabel</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="To create plots that share a common axis (visually) you can set the hspace between the subplots to zero. Passing sharex=True when creating the subplots will automatically turn off all x ticks and labels except those on the bottom axis.">

.. only:: html

  .. image:: /gallery/subplots_axes_and_figures/images/thumb/sphx_glr_ganged_plots_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_subplots_axes_and_figures_ganged_plots.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Adjacent subplots</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This shows 4 possible geographic projections.  Cartopy_ supports more projections.">

.. only:: html

  .. image:: /gallery/subplots_axes_and_figures/images/thumb/sphx_glr_geo_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_subplots_axes_and_figures_geo_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Geographic Projections</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Sometimes we want to combine two subplots in an Axes layout created with subplots.  We can get the GridSpec from the Axes and then remove the covered Axes and fill the gap with a new bigger Axes. Here we create a layout with the bottom two Axes in the last column combined.">

.. only:: html

  .. image:: /gallery/subplots_axes_and_figures/images/thumb/sphx_glr_gridspec_and_subplots_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_subplots_axes_and_figures_gridspec_and_subplots.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Combine two subplots using subplots and GridSpec</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates the use of GridSpec to generate subplots, the control of the relative sizes of subplots with width_ratios and height_ratios, and the control of the spacing around and between subplots using subplot params (left, right, bottom, top, wspace, and hspace).">

.. only:: html

  .. image:: /gallery/subplots_axes_and_figures/images/thumb/sphx_glr_gridspec_customization_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_subplots_axes_and_figures_gridspec_customization.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">GridSpec with variable sizes and spacing</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="GridSpec is a flexible way to layout subplot grids.  Here is an example with a 3x3 grid, and axes spanning all three columns, two columns, and two rows.">

.. only:: html

  .. image:: /gallery/subplots_axes_and_figures/images/thumb/sphx_glr_gridspec_multicolumn_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_subplots_axes_and_figures_gridspec_multicolumn.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Gridspec for multi-column/row subplot layouts</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="GridSpecs can be nested, so that a subplot from a parent GridSpec can set the position for a nested grid of subplots.">

.. only:: html

  .. image:: /gallery/subplots_axes_and_figures/images/thumb/sphx_glr_gridspec_nested_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_subplots_axes_and_figures_gridspec_nested.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Nested Gridspecs</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates two ways to invert the direction of an axis:">

.. only:: html

  .. image:: /gallery/subplots_axes_and_figures/images/thumb/sphx_glr_invert_axes_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_subplots_axes_and_figures_invert_axes.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Inverted axis</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="matplotlib.pyplot uses the concept of a current figure and current Axes. Figures are identified via a figure number that is passed to figure. The figure with the given number is set as current figure. Additionally, if no figure with the number exists, a new one is created.">

.. only:: html

  .. image:: /gallery/subplots_axes_and_figures/images/thumb/sphx_glr_multiple_figs_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_subplots_axes_and_figures_multiple_figs_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Manage multiple figures in pyplot</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Sometimes we want a secondary axis on a plot, for instance to convert radians to degrees on the same plot.  We can do this by making a child axes with only one axis visible via axes.Axes.secondary_xaxis and axes.Axes.secondary_yaxis.  This secondary axis can have a different scale than the main axis by providing both a forward and an inverse conversion function in a tuple to the functions keyword argument:">

.. only:: html

  .. image:: /gallery/subplots_axes_and_figures/images/thumb/sphx_glr_secondary_axis_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_subplots_axes_and_figures_secondary_axis.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Secondary Axis</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="It&#x27;s common to make two or more plots which share an axis, e.g., two subplots with time as a common axis.  When you pan and zoom around on one, you want the other to move around with you.  To facilitate this, matplotlib Axes support a sharex and sharey attribute.  When you create a subplot or axes, you can pass in a keyword indicating what Axes you want to share with.">

.. only:: html

  .. image:: /gallery/subplots_axes_and_figures/images/thumb/sphx_glr_share_axis_lims_views_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_subplots_axes_and_figures_share_axis_lims_views.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Share axis limits and views</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="You can share the x- or y-axis limits for one axis with another by passing an Axes instance as a sharex or sharey keyword argument.">

.. only:: html

  .. image:: /gallery/subplots_axes_and_figures/images/thumb/sphx_glr_shared_axis_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_subplots_axes_and_figures_shared_axis_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Shared axis</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Sometimes it is desirable to have a figure with two different layouts in it. This can be achieved with nested gridspecs&lt;/gallery/subplots_axes_and_figures/gridspec_nested&gt;, but having a virtual figure with its own artists is helpful, so Matplotlib also has &quot;subfigures&quot;, accessed by calling matplotlib.figure.Figure.add_subfigure in a way that is analogous to matplotlib.figure.Figure.add_subplot, or matplotlib.figure.Figure.subfigures to make an array of subfigures.  Note that subfigures can also have their own child subfigures.">

.. only:: html

  .. image:: /gallery/subplots_axes_and_figures/images/thumb/sphx_glr_subfigures_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_subplots_axes_and_figures_subfigures.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Figure subfigures</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Simple demo with multiple subplots.">

.. only:: html

  .. image:: /gallery/subplots_axes_and_figures/images/thumb/sphx_glr_subplot_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_subplots_axes_and_figures_subplot.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Multiple subplots</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates the use of pyplot.subplot2grid to generate subplots.  Using GridSpec, as demonstrated in /gallery/subplots_axes_and_figures/gridspec_customization is generally preferred.">

.. only:: html

  .. image:: /gallery/subplots_axes_and_figures/images/thumb/sphx_glr_subplot2grid_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_subplots_axes_and_figures_subplot2grid.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">subplot2grid</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Adjusting the spacing of margins and subplots using pyplot.subplots_adjust.">

.. only:: html

  .. image:: /gallery/subplots_axes_and_figures/images/thumb/sphx_glr_subplots_adjust_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_subplots_axes_and_figures_subplots_adjust.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Subplots spacings and margins</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="pyplot.subplots creates a figure and a grid of subplots with a single call, while providing reasonable control over how the individual plots are created. For more advanced use cases you can use GridSpec for a more general subplot layout or Figure.add_subplot for adding subplots at arbitrary locations within the figure.">

.. only:: html

  .. image:: /gallery/subplots_axes_and_figures/images/thumb/sphx_glr_subplots_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_subplots_axes_and_figures_subplots_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Create multiple subplots using plt.subplots</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Two plots on the same Axes with different left and right scales.">

.. only:: html

  .. image:: /gallery/subplots_axes_and_figures/images/thumb/sphx_glr_two_scales_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_subplots_axes_and_figures_two_scales.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Plots with different scales</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Example of an inset Axes and a rectangle showing where the zoom is located.">

.. only:: html

  .. image:: /gallery/subplots_axes_and_figures/images/thumb/sphx_glr_zoom_inset_axes_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_subplots_axes_and_figures_zoom_inset_axes.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Zoom region inset Axes</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


Statistics
==========



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates how to use the various keyword arguments to fully customize box plots. The first figure demonstrates how to remove and add individual components (note that the mean is the only value not shown by default). The second figure demonstrates how the styles of the artists can be customized. It also demonstrates how to set the limit of the whiskers to specific percentiles (lower right Axes)">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_boxplot_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_boxplot.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Artist customization in box plots</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="To color each box of a box plot individually:">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_boxplot_color_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_boxplot_color.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Box plots with custom fill colors</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Visualizing boxplots with matplotlib.">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_boxplot_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_boxplot_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Boxplots</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Note that although violin plots are closely related to Tukey&#x27;s (1977) box plots, they add useful information such as the distribution of the sample data (density trace).">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_boxplot_vs_violin_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_boxplot_vs_violin.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Box plot vs. violin plot comparison</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Drawing a boxplot for a given data set, consists of two main operations, that can also be used separately:">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_bxp_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_bxp.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Separate calculation and plotting of boxplots</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows how to plot a confidence ellipse of a two-dimensional dataset, using its pearson correlation coefficient.">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_confidence_ellipse_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_confidence_ellipse.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Plot a confidence ellipse of a two-dimensional dataset</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates how to fully customize violin plots. The first plot shows the default style by providing only the data. The second plot first limits what Matplotlib draws with additional keyword arguments. Then a simplified representation of a box plot is drawn on top. Lastly, the styles of the artists of the violins are modified.">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_customized_violin_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_customized_violin.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Violin plot customization</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This exhibits the most basic use of the error bar method. In this case, constant values are provided for the error in both the x- and y-directions.">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_errorbar_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_errorbar.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Errorbar function</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Errors can be specified as a constant value (as shown in /gallery/statistics/errorbar). However, this example demonstrates how they vary by specifying arrays of error values.">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_errorbar_features_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_errorbar_features.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Different ways of specifying error bars</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="In matplotlib, errors bars can have &quot;limits&quot;. Applying limits to the error bars essentially makes the error unidirectional. Because of that, upper and lower limits can be applied in both the y- and x-directions via the uplims, lolims, xuplims, and xlolims parameters, respectively. These parameters can be scalar or boolean arrays.">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_errorbar_limits_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_errorbar_limits.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Including upper and lower limits in error bars</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="In this example, we snazz up a pretty standard error bar plot by adding a rectangle patch defined by the limits of the bars in both the x- and y- directions. To do this, we have to write our own custom function called make_error_boxes. Close inspection of this function will reveal the preferred pattern in writing functions for matplotlib:">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_errorbars_and_boxes_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_errorbars_and_boxes.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Create boxes from error bars using PatchCollection</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="hexbin is a 2D histogram plot, in which the bins are hexagons and the color represents the number of data points within each bin.">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_hexbin_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_hexbin_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Hexagonal binned plot</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="How to plot histograms with Matplotlib.">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_hist_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_hist.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Histograms</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="How to plot a bihistogram with Matplotlib.">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_histogram_bihistogram_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_histogram_bihistogram.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Bihistogram</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows how to plot the empirical cumulative distribution function (ECDF) of a sample. We also show the theoretical CDF.">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_histogram_cumulative_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_histogram_cumulative.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Cumulative distributions</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip=" Histogram with step curve that has a color fill.  Histogram with step curve with no fill.  Histogram with custom and unequal bin widths.  Two histograms with stacked bars.">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_histogram_histtypes_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_histogram_histtypes.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Demo of the histogram function's different histtype settings</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Plot histogram with multiple sample sets and demonstrate:">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_histogram_multihist_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_histogram_multihist.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">The histogram (hist) function with multiple data sets</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The Axes.hist method can flexibly create histograms in a few different ways, which is flexible and helpful, but can also lead to confusion.  In particular, you can:">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_histogram_normalization_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_histogram_normalization.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Histogram bins, density, and weight</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example plots horizontal histograms of different samples along a categorical x-axis. Additionally, the histograms are plotted to be symmetrical about their x-position, thus making them very similar to violin plots.">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_multiple_histograms_side_by_side_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_multiple_histograms_side_by_side.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Multiple histograms side by side</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates how to efficiently visualize large numbers of time series in a way that could potentially reveal hidden substructure and patterns that are not immediately obvious, and display them in a visually appealing way.">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_time_series_histogram_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_time_series_histogram.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Time Series Histogram</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Violin plots are similar to histograms and box plots in that they show an abstract representation of the probability distribution of the sample. Rather than showing counts of data points that fall into bins or order statistics, violin plots use kernel density estimation (KDE) to compute an empirical distribution of the sample. That computation is controlled by several parameters. This example demonstrates how to modify the number of points at which the KDE is evaluated (``points``) and how to modify the bandwidth of the KDE (``bw_method``).">

.. only:: html

  .. image:: /gallery/statistics/images/thumb/sphx_glr_violinplot_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_statistics_violinplot.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Violin plot basics</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


Pie and polar charts
====================



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demo of plotting a pie chart.">

.. only:: html

  .. image:: /gallery/pie_and_polar_charts/images/thumb/sphx_glr_pie_features_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_pie_and_polar_charts_pie_features.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Pie charts</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Make a &quot;bar of pie&quot; chart where the first slice of the pie is &quot;exploded&quot; into a bar chart with a further breakdown of said slice&#x27;s characteristics. The example demonstrates using a figure with multiple sets of Axes and using the Axes patches list to add two ConnectionPatches to link the subplot charts.">

.. only:: html

  .. image:: /gallery/pie_and_polar_charts/images/thumb/sphx_glr_bar_of_pie_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_pie_and_polar_charts_bar_of_pie.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Bar of pie</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The following examples show two ways to build a nested pie chart in Matplotlib. Such charts are often referred to as donut charts.">

.. only:: html

  .. image:: /gallery/pie_and_polar_charts/images/thumb/sphx_glr_nested_pie_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_pie_and_polar_charts_nested_pie.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Nested pie charts</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Welcome to the Matplotlib bakery. We will create a pie and a donut chart through the pie method &lt;matplotlib.axes.Axes.pie&gt; and show how to label them with a legend &lt;matplotlib.axes.Axes.legend&gt; as well as with annotations &lt;matplotlib.axes.Axes.annotate&gt;.">

.. only:: html

  .. image:: /gallery/pie_and_polar_charts/images/thumb/sphx_glr_pie_and_donut_labels_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_pie_and_polar_charts_pie_and_donut_labels.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">A pie and a donut with labels</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demo of bar plot on a polar axis.">

.. only:: html

  .. image:: /gallery/pie_and_polar_charts/images/thumb/sphx_glr_polar_bar_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_pie_and_polar_charts_polar_bar.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Bar chart on polar axis</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demo of a line plot on a polar axis.">

.. only:: html

  .. image:: /gallery/pie_and_polar_charts/images/thumb/sphx_glr_polar_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_pie_and_polar_charts_polar_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Polar plot</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demo of error bar plot in polar coordinates. Theta error bars are curved lines ended with caps oriented towards the center. Radius error bars are straight lines oriented towards center with perpendicular caps.">

.. only:: html

  .. image:: /gallery/pie_and_polar_charts/images/thumb/sphx_glr_polar_error_caps_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_pie_and_polar_charts_polar_error_caps.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Error bar rendering on polar axis</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Using a legend on a polar-axis plot.">

.. only:: html

  .. image:: /gallery/pie_and_polar_charts/images/thumb/sphx_glr_polar_legend_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_pie_and_polar_charts_polar_legend.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Polar legend</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Size increases radially in this example and color increases with angle (just to verify the symbols are being scattered correctly).">

.. only:: html

  .. image:: /gallery/pie_and_polar_charts/images/thumb/sphx_glr_polar_scatter_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_pie_and_polar_charts_polar_scatter.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Scatter plot on polar axis</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


Text, labels and annotations
============================



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Matplotlib supports accented characters via TeX mathtext or Unicode.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_accented_text_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_accented_text.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Accented text</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Two methods are shown here, one using a short call to Figure.align_ylabels and the second a manual way to align the labels.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_align_ylabels_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_align_ylabels.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Align y-labels</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows how to create a scale invariant angle annotation. It is often useful to mark angles between lines or inside shapes with a circular arc. While Matplotlib provides an Arc, an inherent problem when directly using it for such purposes is that an arc being circular in data space is not necessarily circular in display space. Also, the arc&#x27;s radius is often best defined in a coordinate system which is independent of the actual data coordinates - at least if you want to be able to freely zoom into your plot without the annotation growing to infinity.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_angle_annotation_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_angle_annotation.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Scale invariant angle label</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows how to add angle annotations to bracket arrow styles created using FancyArrowPatch. angleA and angleB are measured from a vertical line as positive (to the left) or negative (to the right). Blue FancyArrowPatch arrows indicate the directions of angleA and angleB from the vertical and axes text annotate the angle sizes.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_angles_on_bracket_arrows_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_angles_on_bracket_arrows.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Angle annotations on bracket arrows</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows how to use different coordinate systems for annotations. For a complete overview of the annotation capabilities, also see the annotation tutorial&lt;annotations&gt;.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_annotate_transform_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_annotate_transform.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Annotate transform</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows how to annotate a plot with an arrow pointing to provided coordinates. We modify the defaults of the arrow, to &quot;shrink&quot; it.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_annotation_basic_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_annotation_basic.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Annotating a plot</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The following examples show ways to annotate plots in Matplotlib. This includes highlighting specific points of interest and using various visual tools to call attention to this point. For a more complete and in-depth description of the annotation and text tools in Matplotlib, see the tutorial on annotation &lt;annotations&gt;.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_annotation_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_annotation_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Annotate plots</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows how to create an annotation on a polar graph.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_annotation_polar_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_annotation_polar.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Annotate polar plots</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Three ways of drawing arrows to encode arrow &quot;strength&quot; (e.g., transition probabilities in a Markov model) using arrow length, width, or alpha (opacity).">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_arrow_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_arrow_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Arrow Demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Matplotlib can wrap text automatically, but if it&#x27;s too long, the text will still be displayed slightly outside the boundaries of the axis.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_autowrap_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_autowrap.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Auto-wrap text</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Composing custom legends piece-by-piece.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_custom_legends_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_custom_legends.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Compose custom legends</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Matplotlib date plotting is done by converting date instances into days since an epoch (by default 1970-01-01T00:00:00). The matplotlib.dates module provides the converter functions date2num and num2date that convert datetime.datetime and numpy.datetime64 objects to and from Matplotlib&#x27;s internal representation.  These data types are registered with the unit conversion mechanism described in matplotlib.units, so the conversion happens automatically for the user. The registration process also sets the default tick locator and formatter for the axis to be AutoDateLocator and AutoDateFormatter.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_date_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_date.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Date tick labels</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="AnnotationBbox creates an annotation using an OffsetBox, and provides more fine-grained control than Axes.annotate.  This example demonstrates the use of AnnotationBbox together with three different OffsetBoxes: TextArea, DrawingArea, and OffsetImage.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_demo_annotation_box_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_demo_annotation_box.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">AnnotationBbox demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="TextPath creates a Path that is the outline of the characters of a text. The resulting path can be employed e.g. as a clip path for an image.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_demo_text_path_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_demo_text_path.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Using a text as a Path</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example illustrates the effect of rotation_mode on the positioning of rotated text.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_demo_text_rotation_mode_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_demo_text_rotation_mode.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Text rotation mode</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="In this example, the differences between the \dfrac and \frac TeX macros are illustrated; in particular, the difference between display style and text style fractions when using Mathtex.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_dfrac_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_dfrac_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">The difference between \dfrac and \frac</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Use of the engineering Formatter.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_engineering_formatter_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_engineering_formatter.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Format ticks using engineering notation</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Overview of the available ArrowStyle settings. These are used for the arrowstyle parameter of annotate and FancyArrowPatch.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_fancyarrow_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_fancyarrow_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Annotation arrow style reference</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows how to style text boxes using bbox parameters.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_fancytextbox_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_fancytextbox_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Styling text boxes</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Rather than plotting a legend on each axis, a legend for all the artists on all the sub-axes of a figure can be plotted instead.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_figlegend_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_figlegend_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Figure legend demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="You can explicitly set which font family is picked up, either by specifying family names of fonts installed on user&#x27;s system, or generic-families (e.g., &#x27;serif&#x27;, &#x27;sans-serif&#x27;, &#x27;monospace&#x27;, &#x27;fantasy&#x27; or &#x27;cursive&#x27;), or a combination of both. (see text_props)">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_font_family_rc_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_font_family_rc.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Configure the font family</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Although it is usually not a good idea to explicitly point to a single ttf file for a font instance, you can do so by passing a pathlib.Path instance as the font parameter.  Note that passing paths as str\s is intentionally not supported, but you can simply wrap str\s in pathlib.Path\s as needed.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_font_file_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_font_file.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Using ttf font files</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Matplotlib&#x27;s font support is provided by the FreeType library.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_font_table_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_font_table.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Font table</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Set font properties using setters.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_fonts_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_fonts_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Fonts demo (object-oriented style)</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Set font properties using keyword arguments.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_fonts_demo_kw_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_fonts_demo_kw.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Fonts demo (keyword arguments)</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Labelling subplots is relatively straightforward, and varies, so Matplotlib does not have a general method for doing this.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_label_subplots_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_label_subplots.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Labelling subplots</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Defining legend labels with plots.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_legend_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_legend.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Legend using pre-defined labels</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="There are many ways to create and customize legends in Matplotlib. Below we&#x27;ll show a few examples for how to do so.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_legend_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_legend_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Legend Demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Override basic methods so an artist can contain another artist.  In this case, the line contains a Text instance to label it.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_line_with_text_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_line_with_text.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Artist within an artist</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Convert texts to images">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_mathtext_asarray_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_mathtext_asarray.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Convert texts to images</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Use Matplotlib&#x27;s internal LaTeX parser and layout engine.  For true LaTeX rendering, see the text.usetex option.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_mathtext_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_mathtext_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Mathtext</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Selected features of Matplotlib&#x27;s math rendering engine.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_mathtext_examples_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_mathtext_examples.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Mathematical expressions</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="A simple example showcasing the new math_fontfamily parameter that can be used to change the family of fonts for each individual text element in a plot.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_mathtext_fontfamily_example_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_mathtext_fontfamily_example.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Math fontfamily</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Multiline">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_multiline_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_multiline.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Multiline</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="When decorating Axes with text boxes, two useful tricks are to place the text in axes coordinates (see transforms_tutorial), so the text doesn&#x27;t move around with changes in x or y limits.  You can also use the bbox property of text to surround the text with a Patch instance -- the bbox keyword argument takes a dictionary with keys that are Patch properties.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_placing_text_boxes_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_placing_text_boxes.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Placing text boxes</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The example strings together several Text objects with different properties (e.g., color or font), positioning each one after the other.  The first Text is created directly using text; all subsequent ones are created with annotate, which allows positioning the Text&#x27;s lower left corner at the lower right corner (``xy=(1, 0)``) of the previous one (``xycoords=text``).">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_rainbow_text_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_rainbow_text.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Concatenate text objects with different properties</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstration of STIX Fonts used in LaTeX rendering.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_stix_fonts_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_stix_fonts_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">STIX Fonts</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="You can use TeX to render all of your Matplotlib text by setting text.usetex to True.  This requires that you have TeX and the other dependencies described in the usetex tutorial properly installed on your system.  Matplotlib caches processed TeX expressions, so that only the first occurrence of an expression triggers a TeX compilation. Later occurrences reuse the rendered image from the cache and are thus faster.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_tex_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_tex_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Render math equations using TeX</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Texts are aligned relative to their anchor point depending on the properties horizontalalignment (default: left) and verticalalignment (default: baseline.)">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_text_alignment_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_text_alignment.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Text alignment</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Plotting text of many different kinds.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_text_commands_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_text_commands.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Text properties</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows how to share parameters across many text objects and labels by creating a dictionary of options passed across several functions.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_text_fontdict_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_text_fontdict.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Controlling style of text and labels using a dictionary</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Text objects in matplotlib are normally rotated with respect to the screen coordinate system (i.e., 45 degrees rotation plots text along a line that is in between horizontal and vertical no matter how the axes are changed).  However, at times one wants to rotate text with respect to something on the plot.  In this case, the correct angle won&#x27;t be the angle of that object in the plot coordinate system, but the angle that that object APPEARS in the screen coordinate system.  This angle can be determined automatically by setting the parameter transform_rotates_text, as shown in the example below.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_text_rotation_relative_to_line_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_text_rotation_relative_to_line.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Text rotation angle in data coordinates</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Matplotlib can display plot titles centered, flush with the left side of a set of Axes, and flush with the right side of a set of Axes.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_titles_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_titles_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Title positioning</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="By default, tick labels at negative values are rendered using a `Unicode minus`__ (U+2212) rather than an ASCII hyphen (U+002D).  This can be controlled by setting axes.unicode_minus.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_unicode_minus_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_unicode_minus.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Unicode minus</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Comparison of text baselines computed for mathtext and usetex.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_usetex_baseline_test_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_usetex_baseline_test.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Usetex text baseline</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This script demonstrates that font effects specified in your pdftex.map are now supported in usetex mode.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_usetex_fonteffects_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_usetex_fonteffects.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Usetex font effects</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="A watermark effect can be achieved by drawing a semi-transparent text.">

.. only:: html

  .. image:: /gallery/text_labels_and_annotations/images/thumb/sphx_glr_watermark_text_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_text_labels_and_annotations_watermark_text.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Text watermark</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


Color
=====

For a description of the colormaps available in Matplotlib,
see the :ref:`colormaps tutorial <tutorials-colors>`.



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Matplotlib recognizes the following formats to specify a color:">

.. only:: html

  .. image:: /gallery/color/images/thumb/sphx_glr_color_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_color_color_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Color Demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Use masked arrays to plot a line with different colors by y-value.">

.. only:: html

  .. image:: /gallery/color/images/thumb/sphx_glr_color_by_yvalue_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_color_color_by_yvalue.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Color by y-value</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Display the colors from the default prop_cycle, which is obtained from the rc parameters&lt;customizing&gt;.">

.. only:: html

  .. image:: /gallery/color/images/thumb/sphx_glr_color_cycle_default_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_color_color_cycle_default.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Colors in the default property cycle</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Matplotlib&#x27;s ColorSequenceRegistry allows access to predefined lists of colors by name e.g. colors = matplotlib.color_sequences[&#x27;Set1&#x27;].  This example shows all of the built in color sequences.">

.. only:: html

  .. image:: /gallery/color/images/thumb/sphx_glr_color_sequences_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_color_color_sequences.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Named color sequences</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Use colorbar by specifying the mappable object (here the AxesImage returned by imshow) and the Axes to attach the colorbar to.">

.. only:: html

  .. image:: /gallery/color/images/thumb/sphx_glr_colorbar_basics_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_color_colorbar_basics.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Colorbar</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Reference for colormaps included with Matplotlib.">

.. only:: html

  .. image:: /gallery/color/images/thumb/sphx_glr_colormap_reference_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_color_colormap_reference.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Colormap reference</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="For more detail on creating and manipulating colormaps see colormap-manipulation.">

.. only:: html

  .. image:: /gallery/color/images/thumb/sphx_glr_custom_cmap_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_color_custom_cmap.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Create a colormap from a list of colors</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Sometimes we want to use more colors or a different set of colors than the default color cycle provides. Selecting individual colors from one of the provided colormaps can be a convenient way to do this.">

.. only:: html

  .. image:: /gallery/color/images/thumb/sphx_glr_individual_colors_from_cmap_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_color_individual_colors_from_cmap.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Selecting individual colors from a colormap</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This plots a list of the named colors supported by Matplotlib. For more information on colors in matplotlib see">

.. only:: html

  .. image:: /gallery/color/images/thumb/sphx_glr_named_colors_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_color_named_colors.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">List of named colors</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Compare setting alpha by the alpha keyword argument and by one of the Matplotlib color formats. Often, the alpha keyword is the only tool needed to add transparency to a color. In some cases, the (matplotlib_color, alpha) color format provides an easy way to fine-tune the appearance of a Figure.">

.. only:: html

  .. image:: /gallery/color/images/thumb/sphx_glr_set_alpha_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_color_set_alpha.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Ways to set a color's alpha value</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>



Shapes and collections
======================



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Adding arrow patches to plots.">

.. only:: html

  .. image:: /gallery/shapes_and_collections/images/thumb/sphx_glr_arrow_guide_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_shapes_and_collections_arrow_guide.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Arrow guide</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example displays several of Matplotlib&#x27;s graphics primitives (artists). A full list of artists is documented at the artist API &lt;artist-api&gt;.">

.. only:: html

  .. image:: /gallery/shapes_and_collections/images/thumb/sphx_glr_artist_reference_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_shapes_and_collections_artist_reference.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Reference for Matplotlib artists</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="For the first two subplots, we will use spirals.  Their size will be set in plot units, not data units.  Their positions will be set in data units by using the offsets and offset_transform keyword arguments of the LineCollection and PolyCollection.">

.. only:: html

  .. image:: /gallery/shapes_and_collections/images/thumb/sphx_glr_collections_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_shapes_and_collections_collections.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Line, Poly and RegularPoly Collection with autoscaling</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Make a compound path -- in this case two simple polygons, a rectangle and a triangle.  Use CLOSEPOLY and MOVETO for the different parts of the compound path">

.. only:: html

  .. image:: /gallery/shapes_and_collections/images/thumb/sphx_glr_compound_path_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_shapes_and_collections_compound_path.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Compound path</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows how to draw, and manipulate shapes given vertices and nodes using the Path, PathPatch and transforms classes.">

.. only:: html

  .. image:: /gallery/shapes_and_collections/images/thumb/sphx_glr_dolphin_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_shapes_and_collections_dolphin.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Dolphins</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Draw donuts (miam!) using Path\s and PathPatch\es. This example shows the effect of the path&#x27;s orientations in a compound path.">

.. only:: html

  .. image:: /gallery/shapes_and_collections/images/thumb/sphx_glr_donut_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_shapes_and_collections_donut.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Mmh Donuts!!!</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This demo shows how to draw an ellipse with an orientation arrow (clockwise or counterclockwise). Compare this to the Ellipse collection example &lt;/gallery/shapes_and_collections/ellipse_collection&gt;.">

.. only:: html

  .. image:: /gallery/shapes_and_collections/images/thumb/sphx_glr_ellipse_arrow_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_shapes_and_collections_ellipse_arrow.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Ellipse with orientation arrow demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Drawing a collection of ellipses. While this would equally be possible using a EllipseCollection or PathCollection, the use of an EllipseCollection allows for much shorter code.">

.. only:: html

  .. image:: /gallery/shapes_and_collections/images/thumb/sphx_glr_ellipse_collection_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_shapes_and_collections_ellipse_collection.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Ellipse Collection</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Draw many ellipses. Here individual ellipses are drawn. Compare this to the Ellipse collection example &lt;/gallery/shapes_and_collections/ellipse_collection&gt;.">

.. only:: html

  .. image:: /gallery/shapes_and_collections/images/thumb/sphx_glr_ellipse_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_shapes_and_collections_ellipse_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Ellipse Demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The following examples show how to plot boxes (`.FancyBboxPatch`) with different visual properties.">

.. only:: html

  .. image:: /gallery/shapes_and_collections/images/thumb/sphx_glr_fancybox_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_shapes_and_collections_fancybox_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Drawing fancy boxes</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Hatches can be added to most polygons in Matplotlib, including bar, fill_between, contourf, and children of Polygon. They are currently supported in the PS, PDF, SVG, macosx, and Agg backends. The WX and Cairo backends do not currently support hatching.">

.. only:: html

  .. image:: /gallery/shapes_and_collections/images/thumb/sphx_glr_hatch_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_shapes_and_collections_hatch_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Hatch demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Hatches can be added to most polygons in Matplotlib, including bar, fill_between, contourf, and children of Polygon. They are currently supported in the PS, PDF, SVG, macosx, and Agg backends. The WX and Cairo backends do not currently support hatching.">

.. only:: html

  .. image:: /gallery/shapes_and_collections/images/thumb/sphx_glr_hatch_style_reference_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_shapes_and_collections_hatch_style_reference.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Hatch style reference</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Matplotlib can efficiently draw multiple lines at once using a LineCollection.">

.. only:: html

  .. image:: /gallery/shapes_and_collections/images/thumb/sphx_glr_line_collection_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_shapes_and_collections_line_collection.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Plot multiple lines using a LineCollection</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates how to use collections.PatchCollection.">

.. only:: html

  .. image:: /gallery/shapes_and_collections/images/thumb/sphx_glr_patch_collection_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_shapes_and_collections_patch_collection.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Circles, Wedges and Polygons</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows how to create Path and PathPatch objects through Matplotlib&#x27;s API.">

.. only:: html

  .. image:: /gallery/shapes_and_collections/images/thumb/sphx_glr_path_patch_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_shapes_and_collections_path_patch.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">PathPatch object</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example showcases the PathPatch object to create a Bezier polycurve path patch.">

.. only:: html

  .. image:: /gallery/shapes_and_collections/images/thumb/sphx_glr_quad_bezier_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_shapes_and_collections_quad_bezier.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Bezier curve</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example showcases a simple scatter plot.">

.. only:: html

  .. image:: /gallery/shapes_and_collections/images/thumb/sphx_glr_scatter_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_shapes_and_collections_scatter.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Scatter plot</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


Style sheets
============



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates the style used in the Bayesian Methods for Hackers [1]_ online book.">

.. only:: html

  .. image:: /gallery/style_sheets/images/thumb/sphx_glr_bmh_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_style_sheets_bmh.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Bayesian Methods for Hackers style sheet</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates the &quot;dark_background&quot; style, which uses white for elements that are typically black (text, borders, etc). Note that not all plot elements default to colors defined by an rc parameter.">

.. only:: html

  .. image:: /gallery/style_sheets/images/thumb/sphx_glr_dark_background_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_style_sheets_dark_background.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Dark background style sheet</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This shows an example of the &quot;fivethirtyeight&quot; styling, which tries to replicate the styles from FiveThirtyEight.com.">

.. only:: html

  .. image:: /gallery/style_sheets/images/thumb/sphx_glr_fivethirtyeight_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_style_sheets_fivethirtyeight.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">FiveThirtyEight style sheet</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates the &quot;ggplot&quot; style, which adjusts the style to emulate ggplot_ (a popular plotting package for R_).">

.. only:: html

  .. image:: /gallery/style_sheets/images/thumb/sphx_glr_ggplot_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_style_sheets_ggplot.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">ggplot style sheet</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates the &quot;grayscale&quot; style sheet, which changes all colors that are defined as rcParams to grayscale. Note, however, that not all plot elements respect rcParams.">

.. only:: html

  .. image:: /gallery/style_sheets/images/thumb/sphx_glr_grayscale_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_style_sheets_grayscale.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Grayscale style sheet</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates the &quot;petroff10&quot; style, which implements the 10-color sequence developed by Matthew A. Petroff [1]_ for accessible data visualization. The style balances aesthetics with accessibility considerations, making it suitable for various types of plots while ensuring readability and distinction between data series.">

.. only:: html

  .. image:: /gallery/style_sheets/images/thumb/sphx_glr_petroff10_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_style_sheets_petroff10.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Petroff10 style sheet</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This shows an example of &quot;Solarized_Light&quot; styling, which tries to replicate the styles of:">

.. only:: html

  .. image:: /gallery/style_sheets/images/thumb/sphx_glr_plot_solarizedlight2_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_style_sheets_plot_solarizedlight2.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Solarized Light stylesheet</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This script demonstrates the different available style sheets on a common set of example plots: scatter plot, image, bar graph, patches, line plot and histogram.">

.. only:: html

  .. image:: /gallery/style_sheets/images/thumb/sphx_glr_style_sheets_reference_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_style_sheets_style_sheets_reference.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Style sheets reference</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


Module - pyplot
===============



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="A simple plot where a list of numbers are plotted against their index, resulting in a straight line. Use a format string (here, &#x27;o-r&#x27;) to set the markers (circles), linestyle (solid line) and color (red).">

.. only:: html

  .. image:: /gallery/pyplots/images/thumb/sphx_glr_pyplot_simple_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_pyplots_pyplot_simple.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Simple plot</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Set the special text objects title, xlabel, and ylabel through the dedicated pyplot functions.  Additional text objects can be placed in the Axes using text.">

.. only:: html

  .. image:: /gallery/pyplots/images/thumb/sphx_glr_pyplot_text_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_pyplots_pyplot_text.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Text and mathtext using pyplot</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Plot three datasets with a single call to plot.">

.. only:: html

  .. image:: /gallery/pyplots/images/thumb/sphx_glr_pyplot_three_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_pyplots_pyplot_three.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Multiple lines using pyplot</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Create a figure with two subplots using pyplot.subplot.">

.. only:: html

  .. image:: /gallery/pyplots/images/thumb/sphx_glr_pyplot_two_subplots_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_pyplots_pyplot_two_subplots.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Two subplots using pyplot</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>



Module - axes_grid1
===================



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Anchored Direction Arrow">

.. only:: html

  .. image:: /gallery/axes_grid1/images/thumb/sphx_glr_demo_anchored_direction_arrows_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axes_grid1_demo_anchored_direction_arrows.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Anchored Direction Arrow</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Axes divider to calculate location of Axes and create a divider for them using existing Axes instances.">

.. only:: html

  .. image:: /gallery/axes_grid1/images/thumb/sphx_glr_demo_axes_divider_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axes_grid1_demo_axes_divider.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Axes divider</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Grid of 2x2 images with a single colorbar or with one colorbar per Axes.">

.. only:: html

  .. image:: /gallery/axes_grid1/images/thumb/sphx_glr_demo_axes_grid_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axes_grid1_demo_axes_grid.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Demo Axes Grid</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Grid of images with shared xaxis and yaxis.">

.. only:: html

  .. image:: /gallery/axes_grid1/images/thumb/sphx_glr_demo_axes_grid2_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axes_grid1_demo_axes_grid2.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Axes Grid2</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Using an HBoxDivider to arrange subplots.">

.. only:: html

  .. image:: /gallery/axes_grid1/images/thumb/sphx_glr_demo_axes_hbox_divider_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axes_grid1_demo_axes_hbox_divider.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">HBoxDivider and VBoxDivider demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="RGBAxes creates a layout of 4 Axes for displaying RGB channels: one large Axes for the RGB image and 3 smaller Axes for the R, G, B channels.">

.. only:: html

  .. image:: /gallery/axes_grid1/images/thumb/sphx_glr_demo_axes_rgb_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axes_grid1_demo_axes_rgb.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Show RGB channels using RGBAxes</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The axes_divider.make_axes_locatable function takes an existing Axes, adds it to a new AxesDivider and returns the AxesDivider.  The append_axes method of the AxesDivider can then be used to create a new Axes on a given side (&quot;top&quot;, &quot;right&quot;, &quot;bottom&quot;, or &quot;left&quot;) of the original Axes. This example uses append_axes to add colorbars next to Axes.">

.. only:: html

  .. image:: /gallery/axes_grid1/images/thumb/sphx_glr_demo_colorbar_with_axes_divider_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axes_grid1_demo_colorbar_with_axes_divider.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Colorbar with AxesDivider</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows how to control the position, height, and width of colorbars using inset_axes.">

.. only:: html

  .. image:: /gallery/axes_grid1/images/thumb/sphx_glr_demo_colorbar_with_inset_locator_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axes_grid1_demo_colorbar_with_inset_locator.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Control the position and size of a colorbar with Inset Axes</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows how to use one common colorbar for each row or column of an image grid.">

.. only:: html

  .. image:: /gallery/axes_grid1/images/thumb/sphx_glr_demo_edge_colorbar_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axes_grid1_demo_edge_colorbar.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Per-row or per-column colorbars</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Note that this can be accomplished with the main library for Axes on Figures that do not change size: fixed_size_axes">

.. only:: html

  .. image:: /gallery/axes_grid1/images/thumb/sphx_glr_demo_fixed_size_axes_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axes_grid1_demo_fixed_size_axes.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Axes with a fixed physical size</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="ImageGrid cells with a fixed aspect ratio">

.. only:: html

  .. image:: /gallery/axes_grid1/images/thumb/sphx_glr_demo_imagegrid_aspect_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axes_grid1_demo_imagegrid_aspect.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">ImageGrid cells with a fixed aspect ratio</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Inset locator demo">

.. only:: html

  .. image:: /gallery/axes_grid1/images/thumb/sphx_glr_inset_locator_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axes_grid1_inset_locator_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Inset locator demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This demo shows how to create a zoomed inset via zoomed_inset_axes. In the first subplot an AnchoredSizeBar shows the zoom effect. In the second subplot a connection to the region of interest is created via mark_inset.">

.. only:: html

  .. image:: /gallery/axes_grid1/images/thumb/sphx_glr_inset_locator_demo2_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axes_grid1_inset_locator_demo2.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Inset locator demo 2</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Make room for ylabel using axes_grid">

.. only:: html

  .. image:: /gallery/axes_grid1/images/thumb/sphx_glr_make_room_for_ylabel_using_axesgrid_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axes_grid1_make_room_for_ylabel_using_axesgrid.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Make room for ylabel using axes_grid</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Parasite Simple">

.. only:: html

  .. image:: /gallery/axes_grid1/images/thumb/sphx_glr_parasite_simple_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axes_grid1_parasite_simple.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Parasite Simple</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Parasite Simple2">

.. only:: html

  .. image:: /gallery/axes_grid1/images/thumb/sphx_glr_parasite_simple2_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axes_grid1_parasite_simple2.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Parasite Simple2</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Show the marginal distributions of a scatter plot as histograms at the sides of the plot.">

.. only:: html

  .. image:: /gallery/axes_grid1/images/thumb/sphx_glr_scatter_hist_locatable_axes_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axes_grid1_scatter_hist_locatable_axes.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Align histogram to scatter plot using locatable Axes</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example illustrates the use of the anchored helper classes found in matplotlib.offsetbox and in mpl_toolkits.axes_grid1. An implementation of a similar figure, but without use of the toolkit, can be found in /gallery/misc/anchored_artists.">

.. only:: html

  .. image:: /gallery/axes_grid1/images/thumb/sphx_glr_simple_anchored_artists_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axes_grid1_simple_anchored_artists.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Simple Anchored Artists</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="See also axes_grid.">

.. only:: html

  .. image:: /gallery/axes_grid1/images/thumb/sphx_glr_simple_axes_divider1_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axes_grid1_simple_axes_divider1.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Simple Axes Divider 1</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="See also axes_grid.">

.. only:: html

  .. image:: /gallery/axes_grid1/images/thumb/sphx_glr_simple_axes_divider3_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axes_grid1_simple_axes_divider3.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Simple axes divider 3</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Align multiple images using ImageGrid.">

.. only:: html

  .. image:: /gallery/axes_grid1/images/thumb/sphx_glr_simple_axesgrid_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axes_grid1_simple_axesgrid.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Simple ImageGrid</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Align multiple images of different sizes using ImageGrid.">

.. only:: html

  .. image:: /gallery/axes_grid1/images/thumb/sphx_glr_simple_axesgrid2_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axes_grid1_simple_axesgrid2.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Simple ImageGrid 2</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Simple Axisline4">

.. only:: html

  .. image:: /gallery/axes_grid1/images/thumb/sphx_glr_simple_axisline4_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axes_grid1_simple_axisline4.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Simple Axisline4</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>



Module - axisartist
===================



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Axis Direction">

.. only:: html

  .. image:: /gallery/axisartist/images/thumb/sphx_glr_axis_direction_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axisartist_axis_direction.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Axis Direction</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="axis_direction demo">

.. only:: html

  .. image:: /gallery/axisartist/images/thumb/sphx_glr_demo_axis_direction_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axisartist_demo_axis_direction.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">axis_direction demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows some configurations for axis style.">

.. only:: html

  .. image:: /gallery/axisartist/images/thumb/sphx_glr_demo_axisline_style_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axisartist_demo_axisline_style.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Axis line styles</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Custom grid and ticklines.">

.. only:: html

  .. image:: /gallery/axisartist/images/thumb/sphx_glr_demo_curvelinear_grid_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axisartist_demo_curvelinear_grid.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Curvilinear grid demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Custom grid and ticklines.">

.. only:: html

  .. image:: /gallery/axisartist/images/thumb/sphx_glr_demo_curvelinear_grid2_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axisartist_demo_curvelinear_grid2.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Demo CurveLinear Grid2</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstration of features of the .floating_axes module:">

.. only:: html

  .. image:: /gallery/axisartist/images/thumb/sphx_glr_demo_floating_axes_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axisartist_demo_floating_axes.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">floating_axes features</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Axis within rectangular frame.">

.. only:: html

  .. image:: /gallery/axisartist/images/thumb/sphx_glr_demo_floating_axis_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axisartist_demo_floating_axis.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">floating_axis demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Create a parasite Axes. Such Axes would share the x scale with a host Axes, but show a different scale in y direction.">

.. only:: html

  .. image:: /gallery/axisartist/images/thumb/sphx_glr_demo_parasite_axes_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axisartist_demo_parasite_axes.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Parasite Axes demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates the use of parasite axis to plot multiple datasets onto one single plot.">

.. only:: html

  .. image:: /gallery/axisartist/images/thumb/sphx_glr_demo_parasite_axes2_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axisartist_demo_parasite_axes2.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Parasite axis demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Ticklabel alignment">

.. only:: html

  .. image:: /gallery/axisartist/images/thumb/sphx_glr_demo_ticklabel_alignment_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axisartist_demo_ticklabel_alignment.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Ticklabel alignment</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Ticklabel direction">

.. only:: html

  .. image:: /gallery/axisartist/images/thumb/sphx_glr_demo_ticklabel_direction_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axisartist_demo_ticklabel_direction.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Ticklabel direction</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Simple axis direction">

.. only:: html

  .. image:: /gallery/axisartist/images/thumb/sphx_glr_simple_axis_direction01_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axisartist_simple_axis_direction01.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Simple axis direction</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="First subplot moves the tick labels to inside the spines. Second subplot moves the ticks to inside the spines. These effects can be obtained for a standard Axes by tick_params.">

.. only:: html

  .. image:: /gallery/axisartist/images/thumb/sphx_glr_simple_axis_direction03_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axisartist_simple_axis_direction03.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Simple axis tick label and tick directions</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Simple axis pad">

.. only:: html

  .. image:: /gallery/axisartist/images/thumb/sphx_glr_simple_axis_pad_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axisartist_simple_axis_pad.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Simple axis pad</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example showcases the use of .axisartist to draw spines at custom positions (here, at y = 0).">

.. only:: html

  .. image:: /gallery/axisartist/images/thumb/sphx_glr_simple_axisartist1_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axisartist_simple_axisartist1.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Custom spines with axisartist</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Simple Axisline">

.. only:: html

  .. image:: /gallery/axisartist/images/thumb/sphx_glr_simple_axisline_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axisartist_simple_axisline.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Simple Axisline</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Simple Axisline3">

.. only:: html

  .. image:: /gallery/axisartist/images/thumb/sphx_glr_simple_axisline3_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_axisartist_simple_axisline3.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Simple Axisline3</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


Showcase
========



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This figure shows the name of several matplotlib elements composing a figure">

.. only:: html

  .. image:: /gallery/showcase/images/thumb/sphx_glr_anatomy_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_showcase_anatomy.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Anatomy of a figure</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows how to create the Firefox logo with path and patches.">

.. only:: html

  .. image:: /gallery/showcase/images/thumb/sphx_glr_firefox_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_showcase_firefox.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Firefox</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Although this is a simple example, it demonstrates some important tweaks:">

.. only:: html

  .. image:: /gallery/showcase/images/thumb/sphx_glr_integral_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_showcase_integral.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Integral as the area under a curve</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The Mandelbrot set rendering can be improved by using a normalized recount associated with a power normalized colormap (gamma=0.3). Rendering can be further enhanced thanks to shading.">

.. only:: html

  .. image:: /gallery/showcase/images/thumb/sphx_glr_mandelbrot_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_showcase_mandelbrot.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Shaded & power normalized rendering</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Example to illustrate how pan/zoom events of overlapping axes are treated.">

.. only:: html

  .. image:: /gallery/showcase/images/thumb/sphx_glr_pan_zoom_overlap_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_showcase_pan_zoom_overlap.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Pan/zoom events of overlapping axes</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="A graph of multiple time series that demonstrates custom styling of plot frame, tick lines, tick labels, and line graph properties. It also uses custom placement of text labels along the right edge as an alternative to a conventional legend.">

.. only:: html

  .. image:: /gallery/showcase/images/thumb/sphx_glr_stock_prices_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_showcase_stock_prices.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Stock prices over 32 years</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Shows how to create an xkcd-like plot.">

.. only:: html

  .. image:: /gallery/showcase/images/thumb/sphx_glr_xkcd_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_showcase_xkcd.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">XKCD</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>



Animation
=========



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example showcases:">

.. only:: html

  .. image:: /gallery/animation/images/thumb/sphx_glr_animate_decay_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_animation_animate_decay.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Decay</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Use histogram&#x27;s BarContainer to draw a bunch of rectangles for an animated histogram.">

.. only:: html

  .. image:: /gallery/animation/images/thumb/sphx_glr_animated_histogram_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_animation_animated_histogram.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Animated histogram</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Generating an animation by calling pause between plotting commands.">

.. only:: html

  .. image:: /gallery/animation/images/thumb/sphx_glr_animation_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_animation_animation_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">pyplot animation</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This animation displays the posterior estimate updates as it is refitted when new data arrives. The vertical line represents the theoretical value to which the plotted distribution should converge.">

.. only:: html

  .. image:: /gallery/animation/images/thumb/sphx_glr_bayes_update_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_animation_bayes_update.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">The Bayes update</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This animation illustrates the double pendulum problem.">

.. only:: html

  .. image:: /gallery/animation/images/thumb/sphx_glr_double_pendulum_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_animation_double_pendulum.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">The double pendulum problem</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Output generated via matplotlib.animation.Animation.to_jshtml.">

.. only:: html

  .. image:: /gallery/animation/images/thumb/sphx_glr_dynamic_image_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_animation_dynamic_image.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Animated image using a precomputed list of images</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Use a MovieWriter directly to grab individual frames and write them to a file.  This avoids any event loop integration, and thus works even with the Agg backend.  This is not recommended for use in an interactive setting.">

.. only:: html

  .. image:: /gallery/animation/images/thumb/sphx_glr_frame_grabbing_sgskip_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_animation_frame_grabbing_sgskip.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Frame grabbing</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example showcases:">

.. only:: html

  .. image:: /gallery/animation/images/thumb/sphx_glr_multiple_axes_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_animation_multiple_axes.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Multiple Axes animation</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example showcases:">

.. only:: html

  .. image:: /gallery/animation/images/thumb/sphx_glr_pause_resume_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_animation_pause_resume.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Pause and resume an animation</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Simulates rain drops on a surface by animating the scale and opacity of 50 scatter points.">

.. only:: html

  .. image:: /gallery/animation/images/thumb/sphx_glr_rain_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_animation_rain.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Rain simulation</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Output generated via matplotlib.animation.Animation.to_jshtml.">

.. only:: html

  .. image:: /gallery/animation/images/thumb/sphx_glr_random_walk_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_animation_random_walk.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Animated 3D random walk</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Output generated via matplotlib.animation.Animation.to_jshtml.">

.. only:: html

  .. image:: /gallery/animation/images/thumb/sphx_glr_simple_anim_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_animation_simple_anim.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Animated line plot</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Output generated via matplotlib.animation.Animation.to_jshtml.">

.. only:: html

  .. image:: /gallery/animation/images/thumb/sphx_glr_simple_scatter_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_animation_simple_scatter.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Animated scatter saved as GIF</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Emulates an oscilloscope.">

.. only:: html

  .. image:: /gallery/animation/images/thumb/sphx_glr_strip_chart_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_animation_strip_chart.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Oscilloscope</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Comparative path demonstration of frequency from a fake signal of a pulsar (mostly known because of the cover for Joy Division&#x27;s Unknown Pleasures).">

.. only:: html

  .. image:: /gallery/animation/images/thumb/sphx_glr_unchained_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_animation_unchained.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Matplotlib unchained</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


Event handling
==============

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



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Example to show connecting events that occur when the figure closes.">

.. only:: html

  .. image:: /gallery/event_handling/images/thumb/sphx_glr_close_event_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_event_handling_close_event.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Close event</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="An example of how to interact with the plotting canvas by connecting to move and click events.">

.. only:: html

  .. image:: /gallery/event_handling/images/thumb/sphx_glr_coords_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_event_handling_coords_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Mouse move and click events</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example adds a cross-hair as a data cursor.  The cross-hair is implemented as regular line objects that are updated on mouse move.">

.. only:: html

  .. image:: /gallery/event_handling/images/thumb/sphx_glr_cursor_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_event_handling_cursor_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Cross-hair cursor</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Connecting data between multiple canvases.">

.. only:: html

  .. image:: /gallery/event_handling/images/thumb/sphx_glr_data_browser_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_event_handling_data_browser.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Data browser</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Illustrate the figure and Axes enter and leave events by changing the frame colors on enter and leave.">

.. only:: html

  .. image:: /gallery/event_handling/images/thumb/sphx_glr_figure_axes_enter_leave_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_event_handling_figure_axes_enter_leave.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Figure/Axes enter and leave events</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This provides examples of uses of interactive functions, such as ginput, waitforbuttonpress and manual clabel placement.">

.. only:: html

  .. image:: /gallery/event_handling/images/thumb/sphx_glr_ginput_manual_clabel_sgskip_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_event_handling_ginput_manual_clabel_sgskip.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Interactive functions</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="In this example a scroll wheel event is used to scroll through 2D slices of 3D data.">

.. only:: html

  .. image:: /gallery/event_handling/images/thumb/sphx_glr_image_slices_viewer_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_event_handling_image_slices_viewer.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Scroll event</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Show how to connect to keypress events.">

.. only:: html

  .. image:: /gallery/event_handling/images/thumb/sphx_glr_keypress_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_event_handling_keypress_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Keypress event</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Use a lasso to select a set of points and get the indices of the selected points. A callback is used to change the color of the selected points.">

.. only:: html

  .. image:: /gallery/event_handling/images/thumb/sphx_glr_lasso_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_event_handling_lasso_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Lasso Demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Enable picking on the legend to toggle the original line on and off">

.. only:: html

  .. image:: /gallery/event_handling/images/thumb/sphx_glr_legend_picking_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_event_handling_legend_picking.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Legend picking</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Example using mouse events to simulate a looking glass for inspecting data.">

.. only:: html

  .. image:: /gallery/event_handling/images/thumb/sphx_glr_looking_glass_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_event_handling_looking_glass.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Looking glass</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Sharing events across GUIs.">

.. only:: html

  .. image:: /gallery/event_handling/images/thumb/sphx_glr_path_editor_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_event_handling_path_editor.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Path editor</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="You can enable picking by setting the &quot;picker&quot; property of an artist (for example, a Matplotlib Line2D, Text, Patch, Polygon, AxesImage, etc.)">

.. only:: html

  .. image:: /gallery/event_handling/images/thumb/sphx_glr_pick_event_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_event_handling_pick_event_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Pick event demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Compute the mean (mu) and standard deviation (sigma) of 100 data sets and plot mu vs. sigma.  When you click on one of the (mu, sigma) points, plot the raw data from the dataset that generated this point.">

.. only:: html

  .. image:: /gallery/event_handling/images/thumb/sphx_glr_pick_event_demo2_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_event_handling_pick_event_demo2.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Pick event demo 2</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This is an example to show how to build cross-GUI applications using Matplotlib event handling to interact with objects on the canvas.">

.. only:: html

  .. image:: /gallery/event_handling/images/thumb/sphx_glr_poly_editor_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_event_handling_poly_editor.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Polygon editor</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="A Matplotlib based game of Pong illustrating one way to write interactive animations that are easily ported to multiple backends.">

.. only:: html

  .. image:: /gallery/event_handling/images/thumb/sphx_glr_pong_sgskip_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_event_handling_pong_sgskip.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Pong</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Downsampling lowers the sample rate or sample size of a signal. In this tutorial, the signal is downsampled when the plot is adjusted through dragging and zooming.">

.. only:: html

  .. image:: /gallery/event_handling/images/thumb/sphx_glr_resample_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_event_handling_resample.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Resampling Data</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Simple example of using general timer objects. This is used to update the time placed in the title of the figure.">

.. only:: html

  .. image:: /gallery/event_handling/images/thumb/sphx_glr_timers_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_event_handling_timers.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Timers</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Example showing the use of a TriFinder object.  As the mouse is moved over the triangulation, the triangle under the cursor is highlighted and the index of the triangle is displayed in the plot title.">

.. only:: html

  .. image:: /gallery/event_handling/images/thumb/sphx_glr_trifinder_event_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_event_handling_trifinder_event_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Trifinder Event Demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Creates two identical panels.  Zooming in on the right panel will show a rectangle in the first panel, denoting the zoomed region.">

.. only:: html

  .. image:: /gallery/event_handling/images/thumb/sphx_glr_viewlims_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_event_handling_viewlims.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Viewlims</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows how to connect events in one window, for example, a mouse press, to another figure window.">

.. only:: html

  .. image:: /gallery/event_handling/images/thumb/sphx_glr_zoom_window_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_event_handling_zoom_window.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Zoom modifies other Axes</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


Miscellaneous
=============



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example illustrates the use of the anchored objects without the helper classes found in mpl_toolkits.axes_grid1. This version of the figure is similar to the one found in /gallery/axes_grid1/simple_anchored_artists, but it is implemented using only the matplotlib namespace, without the help of additional toolkits.">

.. only:: html

  .. image:: /gallery/misc/images/thumb/sphx_glr_anchored_artists_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_misc_anchored_artists.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Anchored Artists</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The lines intersecting the rectangle are colored in red, while the others are left as blue lines. This example showcases the intersects_bbox function.">

.. only:: html

  .. image:: /gallery/misc/images/thumb/sphx_glr_bbox_intersect_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_misc_bbox_intersect.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Identify whether artists intersect</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Example of displaying your own contour lines and polygons using ContourSet.">

.. only:: html

  .. image:: /gallery/misc/images/thumb/sphx_glr_contour_manual_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_misc_contour_manual.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Manual Contour</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Override the default reporting of coords as the mouse moves over the Axes in an interactive backend.">

.. only:: html

  .. image:: /gallery/misc/images/thumb/sphx_glr_coords_report_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_misc_coords_report.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Coords Report</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Showcase Hammer projection by alleviating many features of Matplotlib.">

.. only:: html

  .. image:: /gallery/misc/images/thumb/sphx_glr_custom_projection_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_misc_custom_projection.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Custom projection</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="I&#x27;m not trying to make a good-looking figure here, but just to show some examples of customizing rcParams on the fly.">

.. only:: html

  .. image:: /gallery/misc/images/thumb/sphx_glr_customize_rc_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_misc_customize_rc.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Customize Rc</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Most pixel-based backends in Matplotlib use `Anti-Grain Geometry (AGG)`_ for rendering. You can modify the rendering of Artists by applying a filter via Artist.set_agg_filter.">

.. only:: html

  .. image:: /gallery/misc/images/thumb/sphx_glr_demo_agg_filter_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_misc_demo_agg_filter.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">AGG filter</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Ribbon box">

.. only:: html

  .. image:: /gallery/misc/images/thumb/sphx_glr_demo_ribbon_box_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_misc_demo_ribbon_box.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Ribbon box</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="You can add artists such as a Line2D directly to a figure. This is typically useful for visual structuring.">

.. only:: html

  .. image:: /gallery/misc/images/thumb/sphx_glr_fig_x_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_misc_fig_x.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Add lines directly to a figure</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Fill spiral">

.. only:: html

  .. image:: /gallery/misc/images/thumb/sphx_glr_fill_spiral_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_misc_fill_spiral.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Fill spiral</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Recursively find all objects that match some criteria">

.. only:: html

  .. image:: /gallery/misc/images/thumb/sphx_glr_findobj_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_misc_findobj_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Findobj Demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows how the font tables relate to one another.">

.. only:: html

  .. image:: /gallery/misc/images/thumb/sphx_glr_font_indexing_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_misc_font_indexing.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Font indexing</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example lists the attributes of an FT2Font object, which describe global font properties.  For individual character metrics, use the Glyph object, as returned by load_char.">

.. only:: html

  .. image:: /gallery/misc/images/thumb/sphx_glr_ftface_props_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_misc_ftface_props.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Font properties</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Using a path patch to draw rectangles.">

.. only:: html

  .. image:: /gallery/misc/images/thumb/sphx_glr_histogram_path_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_misc_histogram_path.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Building histograms using Rectangles and PolyCollections</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates how to set a hyperlinks on various kinds of elements.">

.. only:: html

  .. image:: /gallery/misc/images/thumb/sphx_glr_hyperlinks_sgskip_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_misc_hyperlinks_sgskip.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Hyperlinks</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="You can use Matplotlib to generate thumbnails from existing images. Matplotlib relies on Pillow_ for reading images, and thus supports all formats supported by Pillow.">

.. only:: html

  .. image:: /gallery/misc/images/thumb/sphx_glr_image_thumbnail_sgskip_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_misc_image_thumbnail_sgskip.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Image thumbnail</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Some data structures, like dict, structured numpy array or pandas.DataFrame provide access to labelled data via string index access data[key].">

.. only:: html

  .. image:: /gallery/misc/images/thumb/sphx_glr_keyword_plotting_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_misc_keyword_plotting.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Plotting with keywords</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example generates the current matplotlib logo.">

.. only:: html

  .. image:: /gallery/misc/images/thumb/sphx_glr_logos2_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_misc_logos2.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Matplotlib logo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This is a demo of creating a pdf file with several pages, as well as adding metadata and annotations to pdf files.">

.. only:: html

  .. image:: /gallery/misc/images/thumb/sphx_glr_multipage_pdf_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_misc_multipage_pdf.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Multipage PDF</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demo of using multiprocessing for generating data in one process and plotting in another.">

.. only:: html

  .. image:: /gallery/misc/images/thumb/sphx_glr_multiprocess_sgskip_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_misc_multiprocess_sgskip.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Multiprocessing</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Create a packed-bubble chart to represent scalar data. The presented algorithm tries to move all bubbles as close to the center of mass as possible while avoiding some collisions by moving around colliding objects. In this example we plot the market share of different desktop browsers. (source: https://gs.statcounter.com/browser-market-share/desktop/worldwidev)">

.. only:: html

  .. image:: /gallery/misc/images/thumb/sphx_glr_packed_bubbles_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_misc_packed_bubbles.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Packed-bubble chart</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Patheffect Demo">

.. only:: html

  .. image:: /gallery/misc/images/thumb/sphx_glr_patheffect_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_misc_patheffect_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Patheffect Demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="print png to standard out">

.. only:: html

  .. image:: /gallery/misc/images/thumb/sphx_glr_print_stdout_sgskip_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_misc_print_stdout_sgskip.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Print image to stdout</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Rasterization converts vector graphics into a raster image (pixels). It can speed up rendering and produce smaller files for large data sets, but comes at the cost of a fixed resolution.">

.. only:: html

  .. image:: /gallery/misc/images/thumb/sphx_glr_rasterization_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_misc_rasterization_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Rasterization for vector graphics</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The pyplot interface allows you to use setp and getp to set and get object properties respectively, as well as to do introspection on the object.">

.. only:: html

  .. image:: /gallery/misc/images/thumb/sphx_glr_set_and_get_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_misc_set_and_get.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Set and get properties</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrate SVG filtering effects which might be used with Matplotlib.">

.. only:: html

  .. image:: /gallery/misc/images/thumb/sphx_glr_svg_filter_line_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_misc_svg_filter_line.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Apply SVG filter to a line</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrate SVG filtering effects which might be used with Matplotlib. The pie chart drawing code is borrowed from pie_demo.py">

.. only:: html

  .. image:: /gallery/misc/images/thumb/sphx_glr_svg_filter_pie_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_misc_svg_filter_pie.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">SVG filter pie</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demo of table function to display a table within a plot.">

.. only:: html

  .. image:: /gallery/misc/images/thumb/sphx_glr_table_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_misc_table_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Table Demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Matplotlib&#x27;s .patheffects can be used to alter the way paths are drawn at a low enough level that they can affect almost anything.">

.. only:: html

  .. image:: /gallery/misc/images/thumb/sphx_glr_tickedstroke_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_misc_tickedstroke_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">TickedStroke patheffect</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This illustrates the use of transforms.offset_copy to make a transform that positions a drawing element such as a text string at a specified offset in screen coordinates (dots or inches) relative to a location given in any coordinates.">

.. only:: html

  .. image:: /gallery/misc/images/thumb/sphx_glr_transoffset_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_misc_transoffset.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">transforms.offset_copy</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The drawing order of artists is determined by their zorder attribute, which is a floating point number. Artists with higher zorder are drawn on top. You can change the order for individual artists by setting their zorder. The default value depends on the type of the Artist:">

.. only:: html

  .. image:: /gallery/misc/images/thumb/sphx_glr_zorder_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_misc_zorder_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Zorder Demo</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>



3D plotting
===========



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrates using ax.plot&#x27;s zdir keyword to plot 2D data on selective axes of a 3D plot.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_2dcollections3d_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_2dcollections3d.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Plot 2D data on 3D plot</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="A basic demo of how to plot 3D bars with and without shading.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_3d_bars_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_3d_bars.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Demo of 3D bar charts</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrate clipping of line and marker data to the axes view limits. The axlim_clip keyword argument can be used in any of the 3D plotting functions.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_axlim_clip_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_axlim_clip.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Clip the data to the axes view limits</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrates making a 3D plot which has 2D bar graphs projected onto planes y=0, y=1, etc.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_bars3d_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_bars3d.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Create 2D bar graphs in different planes</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Given data on a gridded volume X, Y, Z, this example plots the data values on the volume surfaces.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_box3d_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_box3d.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">3D box surface plot</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This is like a contour plot in 2D except that the f(x, y)=c curve is plotted on the plane z=c.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_contour3d_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_contour3d.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Plot contour (level) curves in 3D</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This modification of the contour3d example uses extend3d=True to extend the curves vertically into &#x27;ribbons&#x27;.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_contour3d_2_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_contour3d_2.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Plot contour (level) curves in 3D using the extend3d option</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Project contour profiles onto a graph">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_contour3d_3_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_contour3d_3.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Project contour profiles onto a graph</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Axes3D.contourf differs from Axes3D.contour in that it creates filled contours, i.e. a discrete number of colours are used to shade the domain.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_contourf3d_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_contourf3d.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Filled contours</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Project filled contour onto a graph">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_contourf3d_2_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_contourf3d_2.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Project filled contour onto a graph</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrates using custom hillshading in a 3D surface plot.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_custom_shaded_3d_surface_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_custom_shaded_3d_surface.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Custom hillshading in a 3D surface plot</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="An example of using errorbars with upper and lower limits in mplot3d.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_errorbar3d_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_errorbar3d.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">3D errorbars</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrate how to fill the space between 3D lines with surfaces. Here we create a sort of &quot;lampshade&quot; shape.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_fillbetween3d_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_fillbetween3d.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Fill between 3D lines</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrate how to create polygons which fill the space under a line graph. In this example polygons are semi-transparent, creating a sort of &#x27;jagged stained glass&#x27; effect.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_fillunder3d_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_fillunder3d.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Fill under 3D line graphs</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demo of a histogram for 2D data as a bar graph in 3D.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_hist3d_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_hist3d.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Create 3D histogram of 2D data</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates how to plot 2D color coded images (similar to Axes.imshow) as a plane in 3D.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_imshow3d_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_imshow3d.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">2D images in 3D</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This examples demonstrates drawing intersecting planes in 3D. It is a generalization of /gallery/mplot3d/imshow3d.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_intersecting_planes_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_intersecting_planes.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Intersecting planes</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates plotting a parametric curve in 3D.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_lines3d_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_lines3d.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Parametric curve</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This is an example of plotting Edward Lorenz&#x27;s 1963 `&quot;Deterministic Nonperiodic Flow&quot;`_ in a 3-dimensional space using mplot3d.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_lorenz_attractor_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_lorenz_attractor.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Lorenz attractor</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows a how to plot a 2D and a 3D plot on the same figure.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_mixed_subplots_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_mixed_subplots.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">2D and 3D Axes in same figure</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates mplot3d&#x27;s offset text display. As one rotates the 3D figure, the offsets should remain oriented the same way as the axis label, and should also be located &quot;away&quot; from the center of the plot.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_offset_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_offset.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Automatic text offsetting</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrate using pathpatch_2d_to_3d to &#x27;draw&#x27; shapes and text on a 3D plot.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_pathpatch3d_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_pathpatch3d.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Draw flat objects in 3D plot</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrate how to create polygons in 3D. Here we stack 3 hexagons.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_polys3d_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_polys3d.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Generate 3D polygons</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrates the different camera projections for 3D plots, and the effects of changing the focal length for a perspective projection. Note that Matplotlib corrects for the &#x27;zoom&#x27; effect of changing the focal length.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_projections_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_projections.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">3D plot projection types</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrates plotting directional arrows at points on a 3D meshgrid.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_quiver3d_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_quiver3d.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">3D quiver plot</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="A very simple animation of a rotating 3D plot about all three axes.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_rotate_axes3d_sgskip_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_rotate_axes3d_sgskip.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Rotating a 3D plot</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstration of a basic scatterplot in 3D.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_scatter3d_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_scatter3d.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">3D scatterplot</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstration of a stem plot in 3D, which plots vertical lines from a baseline to the z-coordinate and places a marker at the tip.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_stem3d_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_stem3d_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">3D stem</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrate including 3D plots as subplots.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_subplot3d_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_subplot3d.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">3D plots as subplots</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrates plotting a 3D surface colored with the coolwarm colormap. The surface is made opaque by using antialiased=False.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_surface3d_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_surface3d.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">3D surface (colormap)</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrates a very basic plot of a 3D surface using a solid color.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_surface3d_2_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_surface3d_2.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">3D surface (solid color)</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrates plotting a 3D surface colored in a checkerboard pattern.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_surface3d_3_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_surface3d_3.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">3D surface (checkerboard)</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrates plotting a surface defined in polar coordinates. Uses the reversed version of the YlGnBu colormap. Also demonstrates writing axis labels with latex math mode.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_surface3d_radial_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_surface3d_radial.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">3D surface with polar coordinates</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrates the placement of text annotations on a 3D plot.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_text3d_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_text3d.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Text annotations in 3D</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Contour plots of unstructured triangular grids.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_tricontour3d_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_tricontour3d.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Triangular 3D contour plot</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Filled contour plots of unstructured triangular grids.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_tricontourf3d_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_tricontourf3d.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Triangular 3D filled contour plot</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Plot a 3D surface with a triangular mesh.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_trisurf3d_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_trisurf3d.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Triangular 3D surfaces</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Two additional examples of plotting surfaces with triangular mesh.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_trisurf3d_2_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_trisurf3d_2.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">More triangular 3D surfaces</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example generates an &quot;unfolded&quot; 3D plot that shows each of the primary 3D view planes. The elevation, azimuth, and roll angles required for each view are labeled. You could print out this image and fold it into a box where each plane forms a side of the box.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_view_planes_3d_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_view_planes_3d.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Primary 3D view planes</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrates plotting 3D volumetric objects with Axes3D.voxels.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_voxels_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_voxels.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">3D voxel / volumetric plot</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrates using Axes3D.voxels with uneven coordinates.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_voxels_numpy_logo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_voxels_numpy_logo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">3D voxel plot of the NumPy logo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrates using Axes3D.voxels to visualize parts of a color space.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_voxels_rgb_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_voxels_rgb.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">3D voxel / volumetric plot with RGB colors</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrates using the x, y, z parameters of Axes3D.voxels.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_voxels_torus_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_voxels_torus.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">3D voxel / volumetric plot with cylindrical coordinates</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="A very basic demonstration of a wireframe plot.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_wire3d_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_wire3d.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">3D wireframe plot</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="A very simple &quot;animation&quot; of a 3D plot.  See also rotate_axes3d_sgskip.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_wire3d_animation_sgskip_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_wire3d_animation_sgskip.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Animate a 3D wireframe plot</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrates that setting rstride or cstride to 0 causes wires to not be generated in the corresponding direction.">

.. only:: html

  .. image:: /gallery/mplot3d/images/thumb/sphx_glr_wire3d_zero_stride_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_mplot3d_wire3d_zero_stride.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">3D wireframe plots in one direction</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


Scales
======

These examples cover how different scales are handled in Matplotlib.



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Illustrate the scale transformations applied to axes, e.g. log, symlog, logit.">

.. only:: html

  .. image:: /gallery/scales/images/thumb/sphx_glr_scales_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_scales_scales.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Scales overview</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Illustration of the asinh &lt;.scale.AsinhScale&gt; axis scaling, which uses the transformation">

.. only:: html

  .. image:: /gallery/scales/images/thumb/sphx_glr_asinh_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_scales_asinh_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Asinh scale</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Loglog aspect">

.. only:: html

  .. image:: /gallery/scales/images/thumb/sphx_glr_aspect_loglog_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_scales_aspect_loglog.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Loglog aspect</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Custom scales can be created in two ways">

.. only:: html

  .. image:: /gallery/scales/images/thumb/sphx_glr_custom_scale_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_scales_custom_scale.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Custom scale</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Examples of plots with logarithmic axes.">

.. only:: html

  .. image:: /gallery/scales/images/thumb/sphx_glr_log_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_scales_log_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Log scale</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Examples of plots with logit axes.">

.. only:: html

  .. image:: /gallery/scales/images/thumb/sphx_glr_logit_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_scales_logit_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Logit scale</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Various normalization on a multivariate normal distribution.">

.. only:: html

  .. image:: /gallery/scales/images/thumb/sphx_glr_power_norm_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_scales_power_norm.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Exploring normalizations</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The symmetric logarithmic scale is an extension of the logarithmic scale that also covers negative values. As with the logarithmic scale, it is particularly useful for numerical data that spans a broad range of values, especially when there are significant differences between the magnitudes of the numbers involved.">

.. only:: html

  .. image:: /gallery/scales/images/thumb/sphx_glr_symlog_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_scales_symlog_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Symlog scale</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


Specialty plots
===============



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrates a few common tricks with shaded plots.">

.. only:: html

  .. image:: /gallery/specialty_plots/images/thumb/sphx_glr_advanced_hillshading_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_specialty_plots_advanced_hillshading.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Hillshading</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="`Anscombe&#x27;s quartet`_ is a group of datasets (x, y) that have the same mean, standard deviation, and regression line, but which are qualitatively different.">

.. only:: html

  .. image:: /gallery/specialty_plots/images/thumb/sphx_glr_anscombe_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_specialty_plots_anscombe.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Anscombe's quartet</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Hinton diagrams are useful for visualizing the values of a 2D array (e.g. a weight matrix): Positive and negative values are represented by white and black squares, respectively, and the size of each square represents the magnitude of each value.">

.. only:: html

  .. image:: /gallery/specialty_plots/images/thumb/sphx_glr_hinton_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_specialty_plots_hinton_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Hinton diagrams</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Ishikawa Diagrams, fishbone diagrams, herringbone diagrams, or cause-and-effect diagrams are used to identify problems in a system by showing how causes and effects are linked. Source: https://en.wikipedia.org/wiki/Ishikawa_diagram">

.. only:: html

  .. image:: /gallery/specialty_plots/images/thumb/sphx_glr_ishikawa_diagram_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_specialty_plots_ishikawa_diagram.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Ishikawa Diagram</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates how to create the 17 segment model for the left ventricle recommended by the American Heart Association (AHA).">

.. only:: html

  .. image:: /gallery/specialty_plots/images/thumb/sphx_glr_leftventricle_bullseye_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_specialty_plots_leftventricle_bullseye.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Left ventricle bullseye</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Displays a set of subplots with an MRI image, its intensity histogram and some EEG traces.">

.. only:: html

  .. image:: /gallery/specialty_plots/images/thumb/sphx_glr_mri_with_eeg_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_specialty_plots_mri_with_eeg.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">MRI with EEG</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example creates a radar chart, also known as a spider or star chart [1]_.">

.. only:: html

  .. image:: /gallery/specialty_plots/images/thumb/sphx_glr_radar_chart_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_specialty_plots_radar_chart.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Radar chart (aka spider or star chart)</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrate the Sankey class by producing three basic diagrams.">

.. only:: html

  .. image:: /gallery/specialty_plots/images/thumb/sphx_glr_sankey_basics_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_specialty_plots_sankey_basics.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">The Sankey class</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrate/test the Sankey class by producing a long chain of connections.">

.. only:: html

  .. image:: /gallery/specialty_plots/images/thumb/sphx_glr_sankey_links_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_specialty_plots_sankey_links.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Long chain of connections using Sankey</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrate the Sankey class with a practical example of a Rankine power cycle.">

.. only:: html

  .. image:: /gallery/specialty_plots/images/thumb/sphx_glr_sankey_rankine_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_specialty_plots_sankey_rankine.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Rankine power cycle</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This serves as an intensive exercise of Matplotlib&#x27;s transforms and custom projection API. This example produces a so-called SkewT-logP diagram, which is a common plot in meteorology for displaying vertical profiles of temperature. As far as Matplotlib is concerned, the complexity comes from having X and Y axes that are not orthogonal. This is handled by including a skew component to the basic Axes transforms. Additional complexity comes in handling the fact that the upper and lower X-axes have different data ranges, which necessitates a bunch of custom classes for ticks, spines, and axis to handle this.">

.. only:: html

  .. image:: /gallery/specialty_plots/images/thumb/sphx_glr_skewt_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_specialty_plots_skewt.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">SkewT-logP diagram: using transforms and custom projections</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrates the visual effect of varying blend mode and vertical exaggeration on &quot;hillshaded&quot; plots.">

.. only:: html

  .. image:: /gallery/specialty_plots/images/thumb/sphx_glr_topographic_hillshading_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_specialty_plots_topographic_hillshading.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Topographic hillshading</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


Spines
======



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This demo compares:">

.. only:: html

  .. image:: /gallery/spines/images/thumb/sphx_glr_spines_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_spines_spines.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Spines</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The position of the axis spines can be influenced using set_position.">

.. only:: html

  .. image:: /gallery/spines/images/thumb/sphx_glr_spine_placement_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_spines_spine_placement_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Spine placement</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demo of spines offset from the axes (a.k.a. &quot;dropped spines&quot;).">

.. only:: html

  .. image:: /gallery/spines/images/thumb/sphx_glr_spines_dropped_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_spines_spines_dropped.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Dropped spines</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Create multiple y axes with a shared x-axis. This is done by creating a twinx Axes, turning all spines but the right one invisible and offset its position using set_position.">

.. only:: html

  .. image:: /gallery/spines/images/thumb/sphx_glr_multiple_yaxis_with_spines_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_spines_multiple_yaxis_with_spines.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Multiple y-axis with Spines</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows a way to draw a &quot;math textbook&quot; style plot, where the spines (&quot;axes lines&quot;) are drawn at x = 0 and y = 0, and have arrows at their ends.">

.. only:: html

  .. image:: /gallery/spines/images/thumb/sphx_glr_centered_spines_with_arrows_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_spines_centered_spines_with_arrows.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Centered spines with arrows</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


Ticks
=====



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Setting the behavior of tick auto-placement.">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_auto_ticks_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_auto_ticks.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Automatically setting tick positions</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Ticklabels are aligned relative to their associated tick. The alignment &#x27;center&#x27;, &#x27;left&#x27;, or &#x27;right&#x27; can be controlled using the horizontal alignment property::">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_centered_ticklabels_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_centered_ticklabels.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Center labels between ticks</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Vertical colorbars have ticks, tick labels, and labels visible on the y axis, horizontal colorbars on the x axis. The ticks parameter can be used to set the ticks and the format parameter can be used to format the tick labels of the visible colorbar Axes. For further adjustments, the yaxis or xaxis Axes of the colorbar can be retrieved using its ax property.">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_colorbar_tick_labelling_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_colorbar_tick_labelling_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Colorbar Tick Labelling</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The matplotlib.ticker module defines many preset tickers, but was primarily designed for extensibility, i.e., to support user customized ticking.">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_custom_ticker1_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_custom_ticker1.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Custom Ticker</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Finding good tick values and formatting the ticks for an axis that has date data is often a challenge.  ConciseDateFormatter is meant to improve the strings chosen for the ticklabels, and to minimize the strings used in those tick labels as much as possible.">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_date_concise_formatter_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_date_concise_formatter.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Format date ticks using ConciseDateFormatter</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Date Demo Convert">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_date_demo_convert_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_date_demo_convert.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Date Demo Convert</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The `iCalender RFC`_ specifies recurrence rules (rrules), that define date sequences. You can use rrules in Matplotlib to place date ticks.">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_date_demo_rrule_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_date_demo_rrule.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Placing date ticks using recurrence rules</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example illustrates the usage and effect of the various date locators and formatters.">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_date_formatters_locators_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_date_formatters_locators.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Date tick locators and formatters</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="When plotting daily data, e.g., financial time series, one often wants to leave out days on which there is no data, for instance weekends, so that the data are plotted at regular intervals without extra spaces for the days with no data. The example shows how to use an &#x27;index formatter&#x27; to achieve the desired plot.">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_date_index_formatter_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_date_index_formatter.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Custom tick formatter for time series</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Matplotlib can handle datetime objects and numpy.datetime64 objects using a unit converter that recognizes these dates and converts them to floating point numbers.">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_date_precision_and_epochs_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_date_precision_and_epochs.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Date precision and epochs</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Use a format string to prepend dollar signs on y-axis labels.">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_dollar_ticks_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_dollar_ticks.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Dollar ticks</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="matplotlib.ticker.EngFormatter is capable of computing a natural offset for your axis data, and presenting it with a standard SI prefix automatically calculated.">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_engformatter_offset_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_engformatter_offset.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">SI prefixed offsets and natural order of magnitudes</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Customize the background, labels and ticks of a simple plot.">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_fig_axes_customize_simple_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_fig_axes_customize_simple.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Fig Axes Customize Simple</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrate how to use major and minor tickers.">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_major_minor_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_major_minor_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Major and minor ticks</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Sometimes we want another level of tick labels on an axis, perhaps to indicate a grouping of the ticks.">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_multilevel_ticks_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_multilevel_ticks.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Multilevel (nested) ticks</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="By default, tick labels are formatted using a ScalarFormatter, which can be configured via ticklabel_format.  This example illustrates some possible configurations:">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_scalarformatter_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_scalarformatter.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">The default tick formatter</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Tick formatters define how the numeric value associated with a tick on an axis is formatted as a string.">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_tick-formatters_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_tick-formatters.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Tick formatters</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Tick locators define the position of the ticks.">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_tick-locators_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_tick-locators.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Tick locators</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="We can use ytick.labelright, ytick.right, ytick.labelleft, and ytick.left to control where on the axes ticks and their labels appear. These properties can also be set in .matplotlib/matplotlibrc.">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_tick_label_right_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_tick_label_right.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Set default y-axis tick labels on the right</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Using Axes.set_xticks causes the tick labels to be set on the currently chosen ticks. However, you may want to allow matplotlib to dynamically choose the number of ticks and their spacing.">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_tick_labels_from_values_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_tick_labels_from_values.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Setting tick labels from a list of values</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="tick_params can be used to configure the ticks. top and labeltop control the visibility tick lines and labels at the top x-axis. To move x-axis ticks from bottom to top, we have to activate the top ticks and deactivate the bottom ticks::">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_tick_xlabel_top_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_tick_xlabel_top.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Move x-axis tick labels to the top</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Rotated tick labels">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_ticklabels_rotation_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_ticklabels_rotation.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Rotated tick labels</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="One common cause for unexpected tick behavior is passing a list of strings instead of numbers or datetime objects. This can easily happen without notice when reading in a comma-delimited text file. Matplotlib treats lists of strings as categorical variables (/gallery/lines_bars_and_markers/categorical_variables), and by default puts one tick per category, and plots them in the order in which they are supplied.  If this is not desired, the solution is to convert the strings to a numeric type as in the following examples.">

.. only:: html

  .. image:: /gallery/ticks/images/thumb/sphx_glr_ticks_too_many_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_ticks_ticks_too_many.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Fixing too many ticks</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>



Units
=====

These examples cover the many representations of units
in Matplotlib.



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The example illustrates how to create text and arrow annotations using a centimeter-scale plot.">

.. only:: html

  .. image:: /gallery/units/images/thumb/sphx_glr_annotate_with_units_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_units_annotate_with_units.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Annotation with units</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Test unit support with each of the Matplotlib primitive artist types.">

.. only:: html

  .. image:: /gallery/units/images/thumb/sphx_glr_artist_tests_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_units_artist_tests.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Artist tests</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="A plot using a variety of centimetre and inch conversions. This example shows how default unit introspection works (ax1), how various keywords can be used to set the x and y units to override the defaults (ax2, ax3, ax4) and how one can set the xlimits using scalars (ax3, current units assumed) or units (conversions applied to get the numbers to current units).">

.. only:: html

  .. image:: /gallery/units/images/thumb/sphx_glr_bar_demo2_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_units_bar_demo2.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Bar demo with units</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This is the same example as the barchart&lt;/gallery/lines_bars_and_markers/barchart&gt; in centimeters.">

.. only:: html

  .. image:: /gallery/units/images/thumb/sphx_glr_bar_unit_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_units_bar_unit_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Group barchart with units</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip=" This file implements a units library that supports registering arbitrary units, conversions between units, and math with unitized data. This library also implements a Matplotlib unit converter and registers its units with Matplotlib. This library is used in the examples to demonstrate Matplotlib&#x27;s unit support. It is only maintained for the purposes of building documentation and should never be used outside of the Matplotlib documentation.">

.. only:: html

  .. image:: /gallery/units/images/thumb/sphx_glr_basic_units_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_units_basic_units.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Basic units</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Compare the ellipse generated with arcs versus a polygonal approximation.">

.. only:: html

  .. image:: /gallery/units/images/thumb/sphx_glr_ellipse_with_units_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_units_ellipse_with_units.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Ellipse with units</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="A mockup &quot;Foo&quot; units class which supports conversion and different tick formatting depending on the &quot;unit&quot;.  Here the &quot;unit&quot; is just a scalar conversion factor, but this example shows that Matplotlib is entirely agnostic to what kind of units client packages use.">

.. only:: html

  .. image:: /gallery/units/images/thumb/sphx_glr_evans_test_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_units_evans_test.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Evans test</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Plot with radians from the basic_units mockup example package.">

.. only:: html

  .. image:: /gallery/units/images/thumb/sphx_glr_radian_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_units_radian_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Radian ticks</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The example illustrates the ability to override default x and y units (ax1) to inches and centimeters using the xunits and yunits parameters for the plot function. Note that conversions are applied to get numbers to correct units.">

.. only:: html

  .. image:: /gallery/units/images/thumb/sphx_glr_units_sample_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_units_units_sample.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Inches and centimeters</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The example below shows support for unit conversions over masked arrays.">

.. only:: html

  .. image:: /gallery/units/images/thumb/sphx_glr_units_scatter_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_units_units_scatter.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Unit handling</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


Embedding Matplotlib in graphical user interfaces
=================================================

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

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



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows how to use the agg backend directly to create images, which may be of use to web application developers who want full control over their code without using the pyplot interface to manage figures, figure closing etc.">

.. only:: html

  .. image:: /gallery/user_interfaces/images/thumb/sphx_glr_canvasagg_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_user_interfaces_canvasagg.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">CanvasAgg demo</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrate NavigationToolbar with GTK3 accessed via pygobject.">

.. only:: html

  .. image:: /gallery/user_interfaces/images/thumb/sphx_glr_embedding_in_gtk3_panzoom_sgskip_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_user_interfaces_embedding_in_gtk3_panzoom_sgskip.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Embed in GTK3 with a navigation toolbar</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrate adding a FigureCanvasGTK3Agg widget to a Gtk.ScrolledWindow using GTK3 accessed via pygobject.">

.. only:: html

  .. image:: /gallery/user_interfaces/images/thumb/sphx_glr_embedding_in_gtk3_sgskip_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_user_interfaces_embedding_in_gtk3_sgskip.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Embed in GTK3</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrate NavigationToolbar with GTK4 accessed via pygobject.">

.. only:: html

  .. image:: /gallery/user_interfaces/images/thumb/sphx_glr_embedding_in_gtk4_panzoom_sgskip_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_user_interfaces_embedding_in_gtk4_panzoom_sgskip.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Embed in GTK4 with a navigation toolbar</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrate adding a FigureCanvasGTK4Agg widget to a Gtk.ScrolledWindow using GTK4 accessed via pygobject.">

.. only:: html

  .. image:: /gallery/user_interfaces/images/thumb/sphx_glr_embedding_in_gtk4_sgskip_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_user_interfaces_embedding_in_gtk4_sgskip.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Embed in GTK4</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Simple Qt application embedding Matplotlib canvases.  This program will work equally well using any Qt binding (PyQt6, PySide6, PyQt5, PySide2).  The binding can be selected by setting the QT_API environment variable to the binding name, or by first importing it.">

.. only:: html

  .. image:: /gallery/user_interfaces/images/thumb/sphx_glr_embedding_in_qt_sgskip_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_user_interfaces_embedding_in_qt_sgskip.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Embed in Qt</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Embed in Tk">

.. only:: html

  .. image:: /gallery/user_interfaces/images/thumb/sphx_glr_embedding_in_tk_sgskip_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_user_interfaces_embedding_in_tk_sgskip.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Embed in Tk</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="An example of how to use wxagg in an application with the new toolbar - comment out the add_toolbar line for no toolbar.">

.. only:: html

  .. image:: /gallery/user_interfaces/images/thumb/sphx_glr_embedding_in_wx2_sgskip_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_user_interfaces_embedding_in_wx2_sgskip.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Embed in wx #2</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Copyright (C) 2003-2004 Andrew Straw, Jeremy O&#x27;Donoghue and others">

.. only:: html

  .. image:: /gallery/user_interfaces/images/thumb/sphx_glr_embedding_in_wx3_sgskip_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_user_interfaces_embedding_in_wx3_sgskip.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Embed in wx #3</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="An example of how to use wxagg in a wx application with a custom toolbar.">

.. only:: html

  .. image:: /gallery/user_interfaces/images/thumb/sphx_glr_embedding_in_wx4_sgskip_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_user_interfaces_embedding_in_wx4_sgskip.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Embed in wx #4</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Embed in wx #5">

.. only:: html

  .. image:: /gallery/user_interfaces/images/thumb/sphx_glr_embedding_in_wx5_sgskip_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_user_interfaces_embedding_in_wx5_sgskip.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Embed in wx #5</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates how to embed Matplotlib WebAgg interactive plotting in your own web application and framework.  It is not necessary to do all this if you merely want to display a plot in a browser or use Matplotlib&#x27;s built-in Tornado-based server &quot;on the side&quot;.">

.. only:: html

  .. image:: /gallery/user_interfaces/images/thumb/sphx_glr_embedding_webagg_sgskip_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_user_interfaces_embedding_webagg_sgskip.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Embedding WebAgg</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Fourier Demo WX">

.. only:: html

  .. image:: /gallery/user_interfaces/images/thumb/sphx_glr_fourier_demo_wx_sgskip_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_user_interfaces_fourier_demo_wx_sgskip.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Fourier Demo WX</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Example of embedding Matplotlib in an application and interacting with a treeview to store data.  Double-click on an entry to update plot data.">

.. only:: html

  .. image:: /gallery/user_interfaces/images/thumb/sphx_glr_gtk3_spreadsheet_sgskip_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_user_interfaces_gtk3_spreadsheet_sgskip.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">GTK3 spreadsheet</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Example of embedding Matplotlib in an application and interacting with a treeview to store data.  Double-click on an entry to update plot data.">

.. only:: html

  .. image:: /gallery/user_interfaces/images/thumb/sphx_glr_gtk4_spreadsheet_sgskip_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_user_interfaces_gtk4_spreadsheet_sgskip.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">GTK4 spreadsheet</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrates how to convert (math)text to a wx.Bitmap for display in various controls on wxPython.">

.. only:: html

  .. image:: /gallery/user_interfaces/images/thumb/sphx_glr_mathtext_wx_sgskip_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_user_interfaces_mathtext_wx_sgskip.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Display mathtext in WX</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Matplotlib with Glade 3">

.. only:: html

  .. image:: /gallery/user_interfaces/images/thumb/sphx_glr_mpl_with_glade3_sgskip_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_user_interfaces_mpl_with_glade3_sgskip.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Matplotlib with Glade 3</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="To use this hook, ensure that this module is in your PYTHONPATH, and set rcParams[&quot;figure.hooks&quot;] = [&quot;mplcvd:setup&quot;].  This hook depends on the colorspacious third-party module.">

.. only:: html

  .. image:: /gallery/user_interfaces/images/thumb/sphx_glr_mplcvd_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_user_interfaces_mplcvd.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">mplcvd -- an example of figure hook</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="An example of how to use pyplot to manage your figure windows, but modify the GUI by accessing the underlying GTK widgets.">

.. only:: html

  .. image:: /gallery/user_interfaces/images/thumb/sphx_glr_pylab_with_gtk3_sgskip_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_user_interfaces_pylab_with_gtk3_sgskip.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">pyplot with GTK3</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="An example of how to use pyplot to manage your figure windows, but modify the GUI by accessing the underlying GTK widgets.">

.. only:: html

  .. image:: /gallery/user_interfaces/images/thumb/sphx_glr_pylab_with_gtk4_sgskip_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_user_interfaces_pylab_with_gtk4_sgskip.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">pyplot with GTK4</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Demonstrate how to create an interactive histogram, in which bars are hidden or shown by clicking on legend markers.">

.. only:: html

  .. image:: /gallery/user_interfaces/images/thumb/sphx_glr_svg_histogram_sgskip_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_user_interfaces_svg_histogram_sgskip.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">SVG Histogram</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows how to create a tooltip that will show up when hovering over a matplotlib patch.">

.. only:: html

  .. image:: /gallery/user_interfaces/images/thumb/sphx_glr_svg_tooltip_sgskip_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_user_interfaces_svg_tooltip_sgskip.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">SVG Tooltip</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates how to">

.. only:: html

  .. image:: /gallery/user_interfaces/images/thumb/sphx_glr_toolmanager_sgskip_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_user_interfaces_toolmanager_sgskip.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Tool Manager</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="When using Matplotlib in a web server it is strongly recommended to not use pyplot (pyplot maintains references to the opened figures to make show work, but this will cause memory leaks unless the figures are properly closed).">

.. only:: html

  .. image:: /gallery/user_interfaces/images/thumb/sphx_glr_web_application_server_sgskip_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_user_interfaces_web_application_server_sgskip.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Embed in a web application server (Flask)</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Example to draw a cursor and report the data coords in wx.">

.. only:: html

  .. image:: /gallery/user_interfaces/images/thumb/sphx_glr_wxcursor_demo_sgskip_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_user_interfaces_wxcursor_demo_sgskip.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Add a cursor in WX</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>

Widgets
=======

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



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Display a data cursor including a text box, which shows the plot point close to the mouse pointer.">

.. only:: html

  .. image:: /gallery/widgets/images/thumb/sphx_glr_annotated_cursor_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_widgets_annotated_cursor.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Annotated cursor</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Constructing a simple button GUI to modify a sine wave.">

.. only:: html

  .. image:: /gallery/widgets/images/thumb/sphx_glr_buttons_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_widgets_buttons.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Buttons</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Turning visual elements on and off with check buttons.">

.. only:: html

  .. image:: /gallery/widgets/images/thumb/sphx_glr_check_buttons_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_widgets_check_buttons.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Check buttons</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Cursor">

.. only:: html

  .. image:: /gallery/widgets/images/thumb/sphx_glr_cursor_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_widgets_cursor.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Cursor</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Interactively selecting data points with the lasso tool.">

.. only:: html

  .. image:: /gallery/widgets/images/thumb/sphx_glr_lasso_selector_demo_sgskip_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_widgets_lasso_selector_demo_sgskip.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Lasso Selector</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Using texts to construct a simple menu.">

.. only:: html

  .. image:: /gallery/widgets/images/thumb/sphx_glr_menu_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_widgets_menu.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Menu</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example sets an alternative cursor on a figure canvas.">

.. only:: html

  .. image:: /gallery/widgets/images/thumb/sphx_glr_mouse_cursor_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_widgets_mouse_cursor.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Mouse Cursor</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Showing a cursor on multiple plots simultaneously.">

.. only:: html

  .. image:: /gallery/widgets/images/thumb/sphx_glr_multicursor_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_widgets_multicursor.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Multicursor</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Shows how one can select indices of a polygon interactively.">

.. only:: html

  .. image:: /gallery/widgets/images/thumb/sphx_glr_polygon_selector_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_widgets_polygon_selector_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Select indices from a collection using polygon selector</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Shows how to create a polygon programmatically or interactively">

.. only:: html

  .. image:: /gallery/widgets/images/thumb/sphx_glr_polygon_selector_simple_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_widgets_polygon_selector_simple.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Polygon Selector</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Using radio buttons to choose properties of your plot.">

.. only:: html

  .. image:: /gallery/widgets/images/thumb/sphx_glr_radio_buttons_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_widgets_radio_buttons.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Radio Buttons</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Using the RangeSlider widget to control the thresholding of an image.">

.. only:: html

  .. image:: /gallery/widgets/images/thumb/sphx_glr_range_slider_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_widgets_range_slider.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Image scaling using a RangeSlider</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Click somewhere, move the mouse, and release the mouse button. RectangleSelector and EllipseSelector draw a rectangle or an ellipse from the initial click position to the current mouse position (within the same axes) until the button is released.  A connected callback receives the click- and release-events.">

.. only:: html

  .. image:: /gallery/widgets/images/thumb/sphx_glr_rectangle_selector_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_widgets_rectangle_selector.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Rectangle and ellipse selectors</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="In this example, sliders are used to control the frequency and amplitude of a sine wave.">

.. only:: html

  .. image:: /gallery/widgets/images/thumb/sphx_glr_slider_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_widgets_slider_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Slider</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="You can snap slider values to discrete values using the valstep argument.">

.. only:: html

  .. image:: /gallery/widgets/images/thumb/sphx_glr_slider_snap_demo_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_widgets_slider_snap_demo.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Snap sliders to discrete values</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The SpanSelector is a mouse widget that enables selecting a range on an axis.">

.. only:: html

  .. image:: /gallery/widgets/images/thumb/sphx_glr_span_selector_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_widgets_span_selector.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Span Selector</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The Textbox widget lets users interactively provide text input, including formulas. In this example, the plot is updated using the on_submit method. This method triggers the execution of the submit function when the user presses enter in the textbox or leaves the textbox.">

.. only:: html

  .. image:: /gallery/widgets/images/thumb/sphx_glr_textbox_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_widgets_textbox.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Textbox</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


Userdemo
========



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates the use of nested GridSpec\s.">

.. only:: html

  .. image:: /gallery/userdemo/images/thumb/sphx_glr_demo_gridspec06_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_userdemo_demo_gridspec06.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Nested GridSpecs</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Simple Legend01">

.. only:: html

  .. image:: /gallery/userdemo/images/thumb/sphx_glr_simple_legend01_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_userdemo_simple_legend01.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Simple Legend01</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Simple Legend02">

.. only:: html

  .. image:: /gallery/userdemo/images/thumb/sphx_glr_simple_legend02_thumb.png
    :alt:

  :ref:`sphx_glr_gallery_userdemo_simple_legend02.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Simple Legend02</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


.. toctree::
   :hidden:
   :includehidden:


   /gallery/lines_bars_and_markers/index.rst
   /gallery/images_contours_and_fields/index.rst
   /gallery/subplots_axes_and_figures/index.rst
   /gallery/statistics/index.rst
   /gallery/pie_and_polar_charts/index.rst
   /gallery/text_labels_and_annotations/index.rst
   /gallery/color/index.rst
   /gallery/shapes_and_collections/index.rst
   /gallery/style_sheets/index.rst
   /gallery/pyplots/index.rst
   /gallery/axes_grid1/index.rst
   /gallery/axisartist/index.rst
   /gallery/showcase/index.rst
   /gallery/animation/index.rst
   /gallery/event_handling/index.rst
   /gallery/misc/index.rst
   /gallery/mplot3d/index.rst
   /gallery/scales/index.rst
   /gallery/specialty_plots/index.rst
   /gallery/spines/index.rst
   /gallery/ticks/index.rst
   /gallery/units/index.rst
   /gallery/user_interfaces/index.rst
   /gallery/widgets/index.rst
   /gallery/userdemo/index.rst


.. only:: html

  .. container:: sphx-glr-footer sphx-glr-footer-gallery

    .. container:: sphx-glr-download sphx-glr-download-python

      :download:`Download all examples in Python source code: gallery_python.zip </gallery/gallery_python.zip>`

    .. container:: sphx-glr-download sphx-glr-download-jupyter

      :download:`Download all examples in Jupyter notebooks: gallery_jupyter.zip </gallery/gallery_jupyter.zip>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_
