<liclass="toctree-l2"><aclass="reference internal" href="MEP/MEP12.html">MEP12: Improve Gallery and Examples</a></li>
<liclass="toctree-l2"><aclass="reference internal" href="MEP/MEP13.html">MEP13: Use properties for Artists</a></li>
<liclass="toctree-l2"><aclass="reference internal" href="MEP/MEP14.html">MEP14: Text handling</a></li>
<liclass="toctree-l2"><aclass="reference internal" href="MEP/MEP15.html">MEP15: Fix axis autoscaling when limits are specified for one axis only</a></li>
<spanid="installing-for-devs"></span><h1>Setting up Matplotlib for development<aclass="headerlink" href="#setting-up-matplotlib-for-development" title="Permalink to this heading">#</a></h1>
<p>To set up Matplotlib for development follow these steps:</p>
<navclass="contents local" id="contents">
<ulclass="simple">
<li><p><aclass="reference internal" href="#fork-the-matplotlib-repository" id="id1">Fork the Matplotlib repository</a></p></li>
<li><p><aclass="reference internal" href="#retrieve-the-latest-version-of-the-code" id="id2">Retrieve the latest version of the code</a></p></li>
<li><p><aclass="reference internal" href="#create-a-dedicated-environment" id="id3">Create a dedicated environment</a></p></li>
<li><p><aclass="reference internal" href="#installing-matplotlib-in-editable-mode" id="id4">Installing Matplotlib in editable mode</a></p></li>
<h2><aclass="toc-backref" href="#id1" role="doc-backlink">Fork the Matplotlib repository</a><aclass="headerlink" href="#fork-the-matplotlib-repository" title="Permalink to this heading">#</a></h2>
<p>Matplotlib is hosted at <aclass="github reference external" href="https://github.com/matplotlib/matplotlib.git">matplotlib/matplotlib.git</a>. If you
plan on solving issues or submit pull requests to the main Matplotlib
repository, you should first <em>fork</em> this repository by visiting
<aclass="github reference external" href="https://github.com/matplotlib/matplotlib.git">matplotlib/matplotlib.git</a> and clicking on the
<codeclass="docutils literal notranslate"><spanclass="pre">Fork</span></code> button on the top right of the page (see
<aclass="reference external" href="https://docs.github.com/get-started/quickstart/fork-a-repo">the GitHub documentation</a> for more details.)</p>
<h2><aclass="toc-backref" href="#id2" role="doc-backlink">Retrieve the latest version of the code</a><aclass="headerlink" href="#retrieve-the-latest-version-of-the-code" title="Permalink to this heading">#</a></h2>
<p>Now that your fork of the repository lives under your GitHub username, you can
retrieve the latest sources with one of the following commands (where your
should replace <codeclass="docutils literal notranslate"><spanclass="pre"><your-username></span></code> with your GitHub username):</p>
<p>This requires you to setup an <aclass="reference external" href="https://docs.github.com/en/authentication/connecting-to-github-with-ssh">SSH key</a> in advance, but saves you from
typing your password at every connection.</p>
</div>
</div>
<p>This will place the sources in a directory <codeclass="file docutils literal notranslate"><spanclass="pre">matplotlib</span></code> below your
current working directory, set up the <codeclass="docutils literal notranslate"><spanclass="pre">origin</span></code> remote to point to your own
fork, and set up the <codeclass="docutils literal notranslate"><spanclass="pre">upstream</span></code> remote to point to the Matplotlib main
repository (see also <aclass="reference external" href="https://docs.github.com/en/get-started/getting-started-with-git/managing-remote-repositories">Managing remote repositories</a>.)
<p>For more information on <codeclass="docutils literal notranslate"><spanclass="pre">git</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">GitHub</span></code>, check the following resources.</p>
<li><p><aclass="reference external" href="https://git-scm.com/book/en/v2/GitHub-Contributing-to-a-Project">GitHub-Contributing to a Project</a></p></li>
<spanid="dev-environment"></span><h2><aclass="toc-backref" href="#id3" role="doc-backlink">Create a dedicated environment</a><aclass="headerlink" href="#create-a-dedicated-environment" title="Permalink to this heading">#</a></h2>
<p>You should set up a dedicated environment to decouple your Matplotlib
development from other Python and Matplotlib installations on your system.</p>
<p>The simplest way to do this is to use either Python's virtual environment
<aclass="reference external" href="https://docs.python.org/3/library/venv.html">venv</a> or <aclass="reference external" href="https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html">conda</a>.</p>
<spanclass="o"><</span><spanclass="n">file</span><spanclass="n">folder</span><spanclass="n">location</span><spanclass="o">></span>\<spanclass="n">Scripts</span>\<spanclass="n">activate</span><spanclass="o">.</span><spanclass="n">bat</span><spanclass="c1"># Windows cmd.exe</span>
<spanclass="o"><</span><spanclass="n">file</span><spanclass="n">folder</span><spanclass="n">location</span><spanclass="o">></span>\<spanclass="n">Scripts</span>\<spanclass="n">Activate</span><spanclass="o">.</span><spanclass="n">ps1</span><spanclass="c1"># Windows PowerShell</span>
<p>Create a new <aclass="reference external" href="https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html">conda</a> environment with</p>
<p>You can use <codeclass="docutils literal notranslate"><spanclass="pre">mamba</span></code> instead of <codeclass="docutils literal notranslate"><spanclass="pre">conda</span></code> in the above command if
you have <aclass="reference external" href="https://mamba.readthedocs.io/en/latest/">mamba</a> installed.</p>
<h2><aclass="toc-backref" href="#id4" role="doc-backlink">Installing Matplotlib in editable mode</a><aclass="headerlink" href="#installing-matplotlib-in-editable-mode" title="Permalink to this heading">#</a></h2>
<p>Install Matplotlib in editable mode from the <codeclass="file docutils literal notranslate"><spanclass="pre">matplotlib</span></code> directory
<h2><aclass="toc-backref" href="#id5" role="doc-backlink">Install pre-commit hooks (optional)</a><aclass="headerlink" href="#install-pre-commit-hooks-optional" title="Permalink to this heading">#</a></h2>
<p><aclass="reference external" href="https://pre-commit.com/">pre-commit</a> hooks automatically check flake8 and
other style issues when you run <codeclass="docutils literal notranslate"><spanclass="pre">git</span><spanclass="pre">commit</span></code>. The hooks are defined in the
top level <codeclass="docutils literal notranslate"><spanclass="pre">.pre-commit-config.yaml</span></code> file. To install the hooks</p>
<p>To run a particular hook manually, run <codeclass="docutils literal notranslate"><spanclass="pre">pre-commit</span><spanclass="pre">run</span></code> with the hook id</p>