View Source code:

Tidy UP & Clean HTML Code - View Source of http://matplotlib.org

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Matplotlib: Python plotting &mdash; Matplotlib 3.1.1 documentation</title>
<link rel="stylesheet" href="_static/mpl.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/graphviz.css" type="text/css" />
<link rel="stylesheet" href="_static/gallery.css" type="text/css" />
<link rel="stylesheet" href="_static/copybutton.css" type="text/css" />
<script type="6a0a27a58cfa5be494248f58-text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script type="6a0a27a58cfa5be494248f58-text/javascript" src="_static/jquery.js"></script>
<script type="6a0a27a58cfa5be494248f58-text/javascript" src="_static/underscore.js"></script>
<script type="6a0a27a58cfa5be494248f58-text/javascript" src="_static/doctools.js"></script>
<script type="6a0a27a58cfa5be494248f58-text/javascript" src="_static/language_data.js"></script>
<script type="6a0a27a58cfa5be494248f58-text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js"></script>
<script type="6a0a27a58cfa5be494248f58-text/javascript" src="_static/copybutton.js"></script>
<script async="async" type="6a0a27a58cfa5be494248f58-text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="search" type="application/opensearchdescription+xml" title="Search within Matplotlib 3.1.1 documentation" href="_static/opensearch.xml" />
<link rel="shortcut icon" href="_static/favicon.ico" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="top" title="Matplotlib 3.1.1 documentation" href="#" />
<link rel="canonical" href="https://matplotlib.org/3.1.1/index.html" />
</head>
<body>
<div style="background-color: white; text-align: left; padding: 10px 10px 15px 15px; position: relative;">
<a href="#">
<div style="float: left; position: absolute; width: 496px; bottom: 0; padding-bottom: 24px"><span style="float: right; color: #789; background: white">Version 3.1.1</span></div>
<script type="text/javascript" style="display:none">
//<![CDATA[
window.__mirage2 = {petok:"03bac7153d7e4a2cdec257a9b511401df0d9c47d-1563614957-1800"};
//]]>
</script>
<script type="text/javascript" src="https://ajax.cloudflare.com/cdn-cgi/scripts/04b3eb47/cloudflare-static/mirage2.min.js"></script>
<img data-cfsrc="_static/logo2.png" height="125px" border="0" alt="matplotlib" style="display:none;visibility:hidden;" /><noscript><img src="_static/logo2.png" height="125px" border="0" alt="matplotlib" /></noscript></a>

<div id="forkongithub"><a href="https://github.com/matplotlib/matplotlib">Fork me on GitHub</a></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index" accesskey="I">index</a></li>
<li class="right">
<a href="py-modindex.html" title="Python Module Index">modules</a> |</li>
<li><a href="#">home</a>|&nbsp;</li>
<li><a href="gallery/index.html">examples</a>|&nbsp;</li>
<li><a href="tutorials/index.html">tutorials</a>|&nbsp;</li>
<li><a href="api/index.html">API</a>|&nbsp;</li>
<li><a href="contents.html">contents</a> &raquo;</li>
</ul>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<script type="6a0a27a58cfa5be494248f58-text/javascript">$('#searchbox').show(0);</script><div class="sidebar-announcement">
<p>Matplotlib 3.0 is Python 3 only.</p>
<p>For Python 2 support, Matplotlib 2.2.x will be continued as a LTS release
and updated with bugfixes until January 1, 2020.</p>
</div>
<div id="sidebar-donations">
<a href="https://numfocus.salsalabs.org/donate-to-matplotlib/index.html" target="_blank"> <div class="donate_button">Support Matplotlib</div></a>
</div>
</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<p>Matplotlib is a Python 2D plotting library which produces publication quality
figures in a variety of hardcopy formats and interactive environments across
platforms. Matplotlib can be used in Python scripts, the Python and <a class="reference external" href="http://ipython.org">IPython</a>
shells, the <a class="reference external" href="http://jupyter.org">Jupyter</a> notebook, web application servers, and four graphical user
interface toolkits.</p>
<div class="responsive_screenshots">
<a href="tutorials/introductory/sample_plots.html">
<div class="responsive_subfig">
<img align="middle" data-cfsrc="_images/sphx_glr_membrane_thumb.png" border="0" alt="screenshots" style="display:none;visibility:hidden;" /><noscript><img align="middle" src="_images/sphx_glr_membrane_thumb.png" border="0" alt="screenshots" /></noscript>
</div>
<div class="responsive_subfig">
<img align="middle" data-cfsrc="_images/sphx_glr_histogram_thumb.png" border="0" alt="screenshots" style="display:none;visibility:hidden;" /><noscript><img align="middle" src="_images/sphx_glr_histogram_thumb.png" border="0" alt="screenshots" /></noscript>
</div>
<div class="responsive_subfig">
<img align="middle" data-cfsrc="_images/sphx_glr_contour_thumb.png" border="0" alt="screenshots" style="display:none;visibility:hidden;" /><noscript><img align="middle" src="_images/sphx_glr_contour_thumb.png" border="0" alt="screenshots" /></noscript>
</div>
<div class="responsive_subfig">
<img align="middle" data-cfsrc="_images/sphx_glr_3D_thumb.png" border="0" alt="screenshots" style="display:none;visibility:hidden;" /><noscript><img align="middle" src="_images/sphx_glr_3D_thumb.png" border="0" alt="screenshots" /></noscript>
</div>
</a>
</div>
<span class="clear_screenshots"></span><p>Matplotlib tries to make easy things easy and hard things possible. You
can generate plots, histograms, power spectra, bar charts, errorcharts,
scatterplots, etc., with just a few lines of code. For examples, see the
<a class="reference internal" href="tutorials/introductory/sample_plots.html"><span class="doc">sample plots</span></a> and <a class="reference internal" href="gallery/index.html"><span class="doc">thumbnail
gallery</span></a>.</p>
<p>For simple plotting the <code class="xref py py-obj docutils literal notranslate"><span class="pre">pyplot</span></code> module provides a MATLAB-like interface,
particularly when combined with IPython. For the power user, you have full
control of line styles, font properties, axes properties, etc, via an object
oriented interface or via a set of functions familiar to MATLAB users.</p>
<div class="section" id="installation">
<h1>Installation<a class="headerlink" href="#installation" title="Permalink to this headline">¶</a></h1>
<p>Visit the <a class="reference internal" href="users/installing.html"><span class="doc">Matplotlib installation instructions</span></a>.</p>
</div>
<div class="section" id="documentation">
<h1>Documentation<a class="headerlink" href="#documentation" title="Permalink to this headline">¶</a></h1>
<p>This is the documentation for Matplotlib version 3.1.1.</p>
<p>To get started, read the <a class="reference internal" href="users/index.html"><span class="doc">User's Guide</span></a>.</p>
<p id="other_versions"></p>
<script type="6a0a27a58cfa5be494248f58-text/javascript">
function getSnippet(id, url) {
   var req = false;
   // For Safari, Firefox, and other non-MS browsers
   if (window.XMLHttpRequest) {
      try {
         req = new XMLHttpRequest();
      } catch (e) {
         req = false;
      }
   } else if (window.ActiveXObject) {
      // For Internet Explorer on Windows
      try {
         req = new ActiveXObject("Msxml2.XMLHTTP");
      } catch (e) {
         try {
         req = new ActiveXObject("Microsoft.XMLHTTP");
         } catch (e) {
         req = false;
         }
      }
   }
   var element = document.getElementById(id);
   if (req) {
      // Synchronous request, wait till we have it all
      req.open('GET', url, false);
      req.send(null);
      if (req.status == 200) {
         element.innerHTML = req.responseText;
      } else {
         element.innerHTML = "<mark>Could not find Snippet to insert at " + url + "</mark>"
      }
   }
}
getSnippet('other_versions', '/versions.html');
</script><p>Trying to learn how to do a particular kind of plot? Check out the
<a class="reference internal" href="gallery/index.html"><span class="doc">examples gallery</span></a> or the <a class="reference internal" href="api/pyplot_summary.html"><span class="doc">list of plotting commands</span></a>.</p>
<div class="section" id="other-learning-resources">
<h2>Other learning resources<a class="headerlink" href="#other-learning-resources" title="Permalink to this headline">¶</a></h2>
<p>There are many <a class="reference internal" href="resources/index.html"><span class="doc">external learning resources</span></a> available
including printed material, videos and tutorials.</p>
</div>
<div class="section" id="need-help">
<h2>Need help?<a class="headerlink" href="#need-help" title="Permalink to this headline">¶</a></h2>
<p>Matplotlib is a welcoming, inclusive project, and we try to follow the <a class="reference external" href="http://www.python.org/psf/codeofconduct/">Python
Software Foundation Code of Conduct</a> in everything we do.</p>
<p>Check the <a class="reference internal" href="faq/index.html"><span class="doc">FAQ</span></a> and the <a class="reference internal" href="api/index.html"><span class="doc">API</span></a> docs.</p>
<p>For help, join the <a class="reference external" href="https://gitter.im/matplotlib/matplotlib">gitter channel</a> and the <a class="reference external" href="https://mail.python.org/mailman/listinfo/matplotlib-users">matplotlib-users</a>,
<a class="reference external" href="https://mail.python.org/mailman/listinfo/matplotlib-devel">matplotlib-devel</a>, and <a class="reference external" href="https://mail.python.org/mailman/listinfo/matplotlib-announce">matplotlib-announce</a> mailing lists, or check out the
Matplotlib tag on <a class="reference external" href="http://stackoverflow.com/questions/tagged/matplotlib">stackoverflow</a>. The <a class="reference external" href="search.html">search</a> tool searches
all of the documentation, including full text search of over 350 complete
examples which exercise almost every corner of Matplotlib.</p>
<p>You can file bugs, patches and feature requests on the <a class="reference external" href="https://github.com/matplotlib/matplotlib/issues">issue tracker</a>, but it
is a good idea to ping us on the mailing list too.</p>
<p>To keep up to date with what's going on in Matplotlib, see the <a class="reference internal" href="users/whats_new.html"><span class="doc">what's
new</span></a> page or browse the <a class="reference external" href="https://github.com/matplotlib/matplotlib">source code</a>. Anything that could
require changes to your existing code is logged in the <a class="reference internal" href="api/api_changes.html"><span class="doc">API changes</span></a> file.</p>
<div class="section" id="toolkits">
<h3>Toolkits<a class="headerlink" href="#toolkits" title="Permalink to this headline">¶</a></h3>
<p>Matplotlib ships with several add-on <a class="reference internal" href="api/toolkits/index.html"><span class="doc">toolkits</span></a>,
including 3d plotting with <code class="xref py py-obj docutils literal notranslate"><span class="pre">mplot3d</span></code>, axes helpers in <code class="xref py py-obj docutils literal notranslate"><span class="pre">axes_grid1</span></code> and axis
helpers in <code class="xref py py-obj docutils literal notranslate"><span class="pre">axisartist</span></code>.</p>
</div>
<div class="section" id="third-party-packages">
<h3>Third party packages<a class="headerlink" href="#third-party-packages" title="Permalink to this headline">¶</a></h3>
<p>A large number of <a class="reference internal" href="thirdpartypackages/index.html"><span class="doc">third party packages</span></a>
extend and build on Matplotlib functionality, including several higher-level
plotting interfaces (<a class="reference external" href="https://seaborn.github.io/">seaborn</a>, <a class="reference external" href="http://holoviews.org">holoviews</a>, <a class="reference external" href="http://ggplot.yhathq.com">ggplot</a>, ...), and two projection
and mapping toolkits (<a class="reference external" href="http://matplotlib.org/basemap">basemap</a> and <a class="reference external" href="http://scitools.org.uk/cartopy/docs/latest">cartopy</a>).</p>
</div>
<div class="section" id="citing-matplotlib">
<h3>Citing Matplotlib<a class="headerlink" href="#citing-matplotlib" title="Permalink to this headline">¶</a></h3>
<p>Matplotlib is the brainchild of John Hunter (1968-2012), who, along with its
many contributors, have put an immeasurable amount of time and effort into
producing a piece of software utilized by thousands of scientists worldwide.</p>
<p>If Matplotlib contributes to a project that leads to a scientific publication,
please acknowledge this work by citing the project. A <a class="reference internal" href="citing.html"><span class="doc">ready-made citation
entry</span></a> is available.</p>
</div>
<div class="section" id="open-source">
<h3>Open source<a class="headerlink" href="#open-source" title="Permalink to this headline">¶</a></h3>
<a href="https://www.numfocus.org/">
<img data-cfsrc="_static/numfocus_badge.png" alt="A Fiscally Sponsored Project of NUMFocus" data-cfstyle="float:right; margin-left:20px" style="display:none;visibility:hidden;" /><noscript><img src="_static/numfocus_badge.png" alt="A Fiscally Sponsored Project of NUMFocus" style="float:right; margin-left:20px" /></noscript>
</a><p>Please consider <a class="reference external" href="https://numfocus.salsalabs.org/donate-to-matplotlib/index.html">donating to the Matplotlib project</a> through
the Numfocus organization or to the <a class="reference external" href="https://www.numfocus.org/programs/john-hunter-technology-fellowship/">John Hunter Technology Fellowship</a>.</p>
<p>The <a class="reference internal" href="users/license.html"><span class="doc">Matplotlib license</span></a> is based on the <a class="reference external" href="http://www.python.org/psf/license">Python Software
Foundation (PSF) license</a>.</p>
<p>There is an active developer community and a long list of people who have made
significant <a class="reference internal" href="users/credits.html"><span class="doc">contributions</span></a>.</p>
<p>Matplotlib is hosted on <a class="reference external" href="https://github.com/matplotlib/matplotlib">Github</a>. <a class="reference external" href="https://github.com/matplotlib/matplotlib/issues">Issues</a>
and <a class="reference external" href="https://github.com/matplotlib/matplotlib/pulls">Pull requests</a> are tracked at Github too.</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy; Copyright 2002 - 2012 John Hunter, Darren Dale, Eric Firing, Michael Droettboom and the Matplotlib development team; 2012 - 2018 The Matplotlib development team.
<br />
Last updated on Jul 09, 2019.
Created using
<a href="http://sphinx-doc.org/">Sphinx</a> 1.8.5.
Doc version v3.1.1-9-g823365338.
</div>
<script type="6a0a27a58cfa5be494248f58-text/javascript">
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-55954603-1', 'auto');
  ga('send', 'pageview');

</script>
<script src="https://ajax.cloudflare.com/cdn-cgi/scripts/95c75768/cloudflare-static/rocket-loader.min.js" data-cf-settings="6a0a27a58cfa5be494248f58-|49" defer=""></script></body>
<footer>
</footer>
</html>