<spanid="sphx-glr-tutorials"></span><spanid="id1"></span><h1>Tutorials<aclass="headerlink" href="#tutorials" title="Permalink to this headline">¶</a></h1>
<p>This page contains more in-depth guides for using Matplotlib.
It is broken up into beginner, intermediate, and advanced sections,
as well as sections covering specific topics.</p>
<p>For shorter examples, see our <aclass="reference external" href="../gallery/index.html">examples page</a>.
You can also find <aclass="reference external" href="../resources/index.html">external resources</a> and
a <aclass="reference external" href="../faq/index.html">FAQ</a> in our <aclass="reference external" href="../contents.html">user guide</a>.</p>
<spanid="tutorials-introductory"></span><spanid="sphx-glr-tutorials-introductory"></span><h2>Introductory<aclass="headerlink" href="#introductory" title="Permalink to this headline">¶</a></h2>
<p>These tutorials cover the basics of creating visualizations with
Matplotlib, as well as some best-practices in using the package
effectively.</p>
<divclass="sphx-glr-thumbcontainer" tooltip="This tutorial covers some basic usage patterns and best-practices to help you get started with ..."><divclass="figure align-default" id="id2">
<pclass="caption"><spanclass="caption-text"><aclass="reference internal" href="introductory/usage.html#sphx-glr-tutorials-introductory-usage-py"><spanclass="std std-ref">Usage Guide</span></a></span><aclass="headerlink" href="#id2" title="Permalink to this image">¶</a></p>
</div>
</div><divclass="toctree-wrapper compound">
</div>
<divclass="sphx-glr-thumbcontainer" tooltip="An introduction to the pyplot interface."><divclass="figure align-default" id="id3">
<pclass="caption"><spanclass="caption-text"><aclass="reference internal" href="introductory/pyplot.html#sphx-glr-tutorials-introductory-pyplot-py"><spanclass="std std-ref">Pyplot tutorial</span></a></span><aclass="headerlink" href="#id3" title="Permalink to this image">¶</a></p>
</div>
</div><divclass="toctree-wrapper compound">
</div>
<divclass="sphx-glr-thumbcontainer" tooltip="Here you'll find a host of example plots with the code that generated them."><divclass="figure align-default" id="id4">
<pclass="caption"><spanclass="caption-text"><aclass="reference internal" href="introductory/sample_plots.html#sphx-glr-tutorials-introductory-sample-plots-py"><spanclass="std std-ref">Sample plots in Matplotlib</span></a></span><aclass="headerlink" href="#id4" title="Permalink to this image">¶</a></p>
</div>
</div><divclass="toctree-wrapper compound">
</div>
<divclass="sphx-glr-thumbcontainer" tooltip="A short tutorial on plotting images with Matplotlib."><divclass="figure align-default" id="id5">
<pclass="caption"><spanclass="caption-text"><aclass="reference internal" href="introductory/images.html#sphx-glr-tutorials-introductory-images-py"><spanclass="std std-ref">Image tutorial</span></a></span><aclass="headerlink" href="#id5" title="Permalink to this image">¶</a></p>
</div>
</div><divclass="toctree-wrapper compound">
</div>
<divclass="sphx-glr-thumbcontainer" tooltip="This tutorial aims to show the beginning, middle, and end of a single visualization using Matpl..."><divclass="figure align-default" id="id6">
<pclass="caption"><spanclass="caption-text"><aclass="reference internal" href="introductory/lifecycle.html#sphx-glr-tutorials-introductory-lifecycle-py"><spanclass="std std-ref">The Lifecycle of a Plot</span></a></span><aclass="headerlink" href="#id6" title="Permalink to this image">¶</a></p>
</div>
</div><divclass="toctree-wrapper compound">
</div>
<divclass="sphx-glr-thumbcontainer" tooltip="Tips for customizing the properties and default styles of Matplotlib."><divclass="figure align-default" id="id7">
<pclass="caption"><spanclass="caption-text"><aclass="reference internal" href="introductory/customizing.html#sphx-glr-tutorials-introductory-customizing-py"><spanclass="std std-ref">Customizing Matplotlib with style sheets and rcParams</span></a></span><aclass="headerlink" href="#id7" title="Permalink to this image">¶</a></p>
</div>
</div><divclass="toctree-wrapper compound">
</div>
<divclass="sphx-glr-clear"></div></div>
<divclass="section" id="intermediate">
<spanid="tutorials-intermediate"></span><spanid="sphx-glr-tutorials-intermediate"></span><h2>Intermediate<aclass="headerlink" href="#intermediate" title="Permalink to this headline">¶</a></h2>
<p>These tutorials cover some of the more complicated classes and functions
in Matplotlib. They can be useful for particular custom and complex
visualizations.</p>
<divclass="sphx-glr-thumbcontainer" tooltip="Using Artist objects to render on the canvas."><divclass="figure align-default" id="id8">
<pclass="caption"><spanclass="caption-text"><aclass="reference internal" href="intermediate/artists.html#sphx-glr-tutorials-intermediate-artists-py"><spanclass="std std-ref">Artist tutorial</span></a></span><aclass="headerlink" href="#id8" title="Permalink to this image">¶</a></p>
</div>
</div><divclass="toctree-wrapper compound">
</div>
<divclass="sphx-glr-thumbcontainer" tooltip="Generating legends flexibly in Matplotlib."><divclass="figure align-default" id="id9">
<pclass="caption"><spanclass="caption-text"><aclass="reference internal" href="intermediate/legend_guide.html#sphx-glr-tutorials-intermediate-legend-guide-py"><spanclass="std std-ref">Legend guide</span></a></span><aclass="headerlink" href="#id9" title="Permalink to this image">¶</a></p>
</div>
</div><divclass="toctree-wrapper compound">
</div>
<divclass="sphx-glr-thumbcontainer" tooltip="Demo of custom property-cycle settings to control colors and other style properties for multi-l..."><divclass="figure align-default" id="id10">
<pclass="caption"><spanclass="caption-text"><aclass="reference internal" href="intermediate/color_cycle.html#sphx-glr-tutorials-intermediate-color-cycle-py"><spanclass="std std-ref">Styling with cycler</span></a></span><aclass="headerlink" href="#id10" title="Permalink to this image">¶</a></p>
</div>
</div><divclass="toctree-wrapper compound">
</div>
<divclass="sphx-glr-thumbcontainer" tooltip="How to create grid-shaped combinations of axes."><divclass="figure align-default" id="id11">
<pclass="caption"><spanclass="caption-text"><aclass="reference internal" href="intermediate/gridspec.html#sphx-glr-tutorials-intermediate-gridspec-py"><spanclass="std std-ref">Customizing Figure Layouts Using GridSpec and Other Functions</span></a></span><aclass="headerlink" href="#id11" title="Permalink to this image">¶</a></p>
</div>
</div><divclass="toctree-wrapper compound">
</div>
<divclass="sphx-glr-thumbcontainer" tooltip="How to use constrained-layout to fit plots within your figure cleanly."><divclass="figure align-default" id="id12">
<pclass="caption"><spanclass="caption-text"><aclass="reference internal" href="intermediate/constrainedlayout_guide.html#sphx-glr-tutorials-intermediate-constrainedlayout-guide-py"><spanclass="std std-ref">Constrained Layout Guide</span></a></span><aclass="headerlink" href="#id12" title="Permalink to this image">¶</a></p>
</div>
</div><divclass="toctree-wrapper compound">
</div>
<divclass="sphx-glr-thumbcontainer" tooltip="How to use tight-layout to fit plots within your figure cleanly."><divclass="figure align-default" id="id13">
<pclass="caption"><spanclass="caption-text"><aclass="reference internal" href="intermediate/tight_layout_guide.html#sphx-glr-tutorials-intermediate-tight-layout-guide-py"><spanclass="std std-ref">Tight Layout guide</span></a></span><aclass="headerlink" href="#id13" title="Permalink to this image">¶</a></p>
</div>
</div><divclass="toctree-wrapper compound">
</div>
<divclass="sphx-glr-thumbcontainer" tooltip="imshow allows you to render an image (either a 2D array which will be color-mapped (based on *n..."><divclass="figure align-default" id="id14">
<pclass="caption"><spanclass="caption-text"><aclass="reference internal" href="intermediate/imshow_extent.html#sphx-glr-tutorials-intermediate-imshow-extent-py"><spanclass="std std-ref">origin and extent in imshow</span></a></span><aclass="headerlink" href="#id14" title="Permalink to this image">¶</a></p>
</div>
</div><divclass="toctree-wrapper compound">
</div>
<divclass="sphx-glr-clear"></div></div>
<divclass="section" id="advanced">
<spanid="tutorials-advanced"></span><spanid="sphx-glr-tutorials-advanced"></span><h2>Advanced<aclass="headerlink" href="#advanced" title="Permalink to this headline">¶</a></h2>
<p>These tutorials cover advanced topics for experienced Matplotlib
users and developers.</p>
<divclass="sphx-glr-thumbcontainer" tooltip="Defining paths in your Matplotlib visualization."><divclass="figure align-default" id="id15">
<pclass="caption"><spanclass="caption-text"><aclass="reference internal" href="advanced/path_tutorial.html#sphx-glr-tutorials-advanced-path-tutorial-py"><spanclass="std std-ref">Path Tutorial</span></a></span><aclass="headerlink" href="#id15" title="Permalink to this image">¶</a></p>
</div>
</div><divclass="toctree-wrapper compound">
</div>
<divclass="sphx-glr-thumbcontainer" tooltip="Defining paths that objects follow on a canvas."><divclass="figure align-default" id="id16">
<pclass="caption"><spanclass="caption-text"><aclass="reference internal" href="advanced/patheffects_guide.html#sphx-glr-tutorials-advanced-patheffects-guide-py"><spanclass="std std-ref">Path effects guide</span></a></span><aclass="headerlink" href="#id16" title="Permalink to this image">¶</a></p>
</div>
</div><divclass="toctree-wrapper compound">
</div>
<divclass="sphx-glr-thumbcontainer" tooltip="Like any graphics packages, Matplotlib is built on top of a transformation framework to easily ..."><divclass="figure align-default" id="id17">
<pclass="caption"><spanclass="caption-text"><aclass="reference internal" href="advanced/transforms_tutorial.html#sphx-glr-tutorials-advanced-transforms-tutorial-py"><spanclass="std std-ref">Transformations Tutorial</span></a></span><aclass="headerlink" href="#id17" title="Permalink to this image">¶</a></p>
</div>
</div><divclass="toctree-wrapper compound">
</div>
<divclass="sphx-glr-clear"></div></div>
<divclass="section" id="colors">
<spanid="tutorials-colors"></span><spanid="sphx-glr-tutorials-colors"></span><h2>Colors<aclass="headerlink" href="#colors" title="Permalink to this headline">¶</a></h2>
<p>Matplotlib has support for visualizing information with a wide array
of colors and colormaps. These tutorials cover the basics of how
these colormaps look, how you can create your own, and how you can
customize colormaps for your use case.</p>
<p>For even more information see the <aclass="reference internal" href="../gallery/index.html#color-examples"><spanclass="std std-ref">examples page</span></a>.</p>
<divclass="sphx-glr-thumbcontainer" tooltip="Matplotlib recognizes the following formats to specify a color:"><divclass="figure align-default" id="id18">
<pclass="caption"><spanclass="caption-text"><aclass="reference internal" href="colors/colors.html#sphx-glr-tutorials-colors-colors-py"><spanclass="std std-ref">Specifying Colors</span></a></span><aclass="headerlink" href="#id18" title="Permalink to this image">¶</a></p>
</div>
</div><divclass="toctree-wrapper compound">
</div>
<divclass="sphx-glr-thumbcontainer" tooltip="This tutorial shows how to build and customize standalone colorbars, i.e. without an attached p..."><divclass="figure align-default" id="id19">
<pclass="caption"><spanclass="caption-text"><aclass="reference internal" href="colors/colorbar_only.html#sphx-glr-tutorials-colors-colorbar-only-py"><spanclass="std std-ref">Customized Colorbars Tutorial</span></a></span><aclass="headerlink" href="#id19" title="Permalink to this image">¶</a></p>
</div>
</div><divclass="toctree-wrapper compound">
</div>
<divclass="sphx-glr-thumbcontainer" tooltip="Matplotlib has a number of built-in colormaps accessible via .matplotlib.cm.get_cmap. There ar..."><divclass="figure align-default" id="id20">
<pclass="caption"><spanclass="caption-text"><aclass="reference internal" href="colors/colormap-manipulation.html#sphx-glr-tutorials-colors-colormap-manipulation-py"><spanclass="std std-ref">Creating Colormaps in Matplotlib</span></a></span><aclass="headerlink" href="#id20" title="Permalink to this image">¶</a></p>
</div>
</div><divclass="toctree-wrapper compound">
</div>
<divclass="sphx-glr-thumbcontainer" tooltip="Objects that use colormaps by default linearly map the colors in the colormap from data values ..."><divclass="figure align-default" id="id21">
<pclass="caption"><spanclass="caption-text"><aclass="reference internal" href="colors/colormapnorms.html#sphx-glr-tutorials-colors-colormapnorms-py"><spanclass="std std-ref">Colormap Normalization</span></a></span><aclass="headerlink" href="#id21" title="Permalink to this image">¶</a></p>
</div>
</div><divclass="toctree-wrapper compound">
</div>
<divclass="sphx-glr-thumbcontainer" tooltip="Matplotlib has a number of built-in colormaps accessible via .matplotlib.cm.get_cmap. There ar..."><divclass="figure align-default" id="id22">
<pclass="caption"><spanclass="caption-text"><aclass="reference internal" href="colors/colormaps.html#sphx-glr-tutorials-colors-colormaps-py"><spanclass="std std-ref">Choosing Colormaps in Matplotlib</span></a></span><aclass="headerlink" href="#id22" title="Permalink to this image">¶</a></p>
</div>
</div><divclass="toctree-wrapper compound">
</div>
<divclass="sphx-glr-clear"></div></div>
<divclass="section" id="text">
<spanid="tutorials-text"></span><spanid="sphx-glr-tutorials-text"></span><h2>Text<aclass="headerlink" href="#text" title="Permalink to this headline">¶</a></h2>
<p>matplotlib has extensive text support, including support for
mathematical expressions, truetype support for raster and
vector outputs, newline separated text with arbitrary
rotations, and unicode support. These tutorials cover
the basics of working with text in Matplotlib.</p>
<divclass="sphx-glr-thumbcontainer" tooltip="Introduction to plotting and working with text in Matplotlib."><divclass="figure align-default" id="id23">
<pclass="caption"><spanclass="caption-text"><aclass="reference internal" href="text/text_intro.html#sphx-glr-tutorials-text-text-intro-py"><spanclass="std std-ref">Text in Matplotlib Plots</span></a></span><aclass="headerlink" href="#id23" title="Permalink to this image">¶</a></p>
</div>
</div><divclass="toctree-wrapper compound">
</div>
<divclass="sphx-glr-thumbcontainer" tooltip="Controlling properties of text and its layout with Matplotlib."><divclass="figure align-default" id="id24">
<pclass="caption"><spanclass="caption-text"><aclass="reference internal" href="text/text_props.html#sphx-glr-tutorials-text-text-props-py"><spanclass="std std-ref">Text properties and layout</span></a></span><aclass="headerlink" href="#id24" title="Permalink to this image">¶</a></p>
</div>
</div><divclass="toctree-wrapper compound">
</div>
<divclass="sphx-glr-thumbcontainer" tooltip="Annotating text with Matplotlib."><divclass="figure align-default" id="id25">
<pclass="caption"><spanclass="caption-text"><aclass="reference internal" href="text/annotations.html#sphx-glr-tutorials-text-annotations-py"><spanclass="std std-ref">Annotations</span></a></span><aclass="headerlink" href="#id25" title="Permalink to this image">¶</a></p>
</div>
</div><divclass="toctree-wrapper compound">
</div>
<divclass="sphx-glr-thumbcontainer" tooltip="An introduction to writing mathematical expressions in Matplotlib."><divclass="figure align-default" id="id26">
<pclass="caption"><spanclass="caption-text"><aclass="reference internal" href="text/pgf.html#sphx-glr-tutorials-text-pgf-py"><spanclass="std std-ref">Typesetting With XeLaTeX/LuaLaTeX</span></a></span><aclass="headerlink" href="#id27" title="Permalink to this image">¶</a></p>
</div>
</div><divclass="toctree-wrapper compound">
</div>
<divclass="sphx-glr-thumbcontainer" tooltip="Rendering text with LaTeX in Matplotlib."><divclass="figure align-default" id="id28">
<pclass="caption"><spanclass="caption-text"><aclass="reference internal" href="text/usetex.html#sphx-glr-tutorials-text-usetex-py"><spanclass="std std-ref">Text rendering With LaTeX</span></a></span><aclass="headerlink" href="#id28" title="Permalink to this image">¶</a></p>
</div>
</div><divclass="toctree-wrapper compound">
</div>
<divclass="sphx-glr-clear"></div></div>
<divclass="section" id="toolkits">
<spanid="tutorials-toolkits"></span><spanid="sphx-glr-tutorials-toolkits"></span><h2>Toolkits<aclass="headerlink" href="#toolkits" title="Permalink to this headline">¶</a></h2>
<p>These tutorials cover toolkits designed to extend the functionality
of Matplotlib in order to accomplish specific goals.</p>
<divclass="sphx-glr-thumbcontainer" tooltip="Controlling the layout of plots with the mpl_toolkits.axes_grid1 toolkit."><divclass="figure align-default" id="id29">
<pclass="caption"><spanclass="caption-text"><aclass="reference internal" href="toolkits/axes_grid.html#sphx-glr-tutorials-toolkits-axes-grid-py"><spanclass="std std-ref">Overview of axes_grid1 toolkit</span></a></span><aclass="headerlink" href="#id29" title="Permalink to this image">¶</a></p>
<pclass="caption"><spanclass="caption-text"><aclass="reference internal" href="toolkits/axisartist.html#sphx-glr-tutorials-toolkits-axisartist-py"><spanclass="std std-ref">Overview of axisartist toolkit</span></a></span><aclass="headerlink" href="#id30" title="Permalink to this image">¶</a></p>
</div>
</div><divclass="toctree-wrapper compound">
</div>
<divclass="sphx-glr-thumbcontainer" tooltip="Generating 3D plots using the mplot3d toolkit."><divclass="figure align-default" id="id31">